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.

Hey! Thanks for the package. For some reason when doing import * as Timer from 'easytimer.js'; I get the error File '/project/node_modules/easytimer.js/index.d.ts' is not a module.

Any idea how to fix that? If I can get it to compile, it appears it does actually work.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
albert-gonzalezcommented, Dec 14, 2018

Hi!

Finally, I solved this issue. I had to change the export of the library, so there is a breaking change in the way to import the library. I made a little migration guide with these changes: https://github.com/albert-gonzalez/easytimer.js/blob/master/MIGRATION.md.

Now you should import without any problem in ES6 or Typescript: import Timer from 'easytimer.js or import { Timer } from 'easytimer.js'

The version with this fix is v3.0.0.

Best Regards!

1reaction
rgsonecommented, Oct 20, 2018

Works fine with import Timer from 'easytimer.js'; here.

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 >
A Comprehensive Look at ES6 Modules - JavaScript Tutorial
An ES6 module is a JavaScript file that executes in strict mode only. It means that any variables or functions declared in the...
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