question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi thanks for building this amazing plugin!

Right now I’m having an issue where I try to import this using Browserify with the ES2015 preset and the plugin is not registering with moment.

This currently doesn’t work

import moment from 'moment'
import 'moment-timer'

This throws a TypeError

var timer  moment.duration(1, 'seconds').timer()

Uncaught TypeError: _moment2.default.duration(...).timer is not a function

I’m using React as well

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Alxmerinocommented, Jun 25, 2017

sorry for the late response guys, I did come up with a response I will post a PR shortly 😄

1reaction
Crydecommented, Jun 25, 2017

It’s because this plugin isn’t wrap into a ‘module’ (I mean a module to be usable by require() or import)

Have a look here : https://github.com/umdjs/umd

Read more comments on GitHub >

github_iconTop Results From Across the Web

import - JavaScript - MDN Web Docs - Mozilla
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are ...
Read more >
ES6 Modules and How to Use Import and Export in JavaScript
The ES2015 (ES6) edition of the JavaScript standard gives us native support for modules with the import and export syntax.
Read more >
16. Modules - Exploring JS
The imports of an ES6 module are read-only views on the exported entities. That means that the connections to variables declared inside module...
Read more >
How to use an ES6 import in Node.js? - GeeksforGeeks
Introduction to ES6 import: The import statement is used to import modules that are exported by some other module. A module is a...
Read more >
Javascript Modules | Export Import Syntax for ES6 Modules
Learn Javascript Modules and the ES6 Module syntax to import and export modules in this Javascript tutorial. Javascript ES6 Modules help you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found