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.

broken es-2015/native-js imports

See original GitHub issue

hey,

between versions 1.2.0 and 1.2.1 you’ve changed the import behaviour for native javascript modules.

import cookie from "cookie_js";

the statement above imports cookie.js in the files execution context. in version 1.2.0 cookie is now an object with the interface described in the readme. in version 1.2.1 it’s an object with a single property called cookie. this is probably a sideeffect of this commit 4203e0090bcaf31ee202264f38616c222998551f.

this problem just sneaked into my codebase and broke one of my modules when i called npm update, because 1.2.1 was a patch release 😉.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
floriancommented, Jul 9, 2019

This should now be fixed in v1.3.0 as of #47, thanks to @banyan.

0reactions
mtsmfmcommented, Feb 6, 2019

@florian Sorry to bother you. #47 can solve this problem so can you have a look at that?

I switched to forked version ("cookie_js": "git+https://github.com/banyan/cookie.js#rollup") and it works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ES2015 import doesn't work (even at top-level) in Firefox
When I load the page in Firefox 46, it returns "SyntaxError: import declarations may only appear at top level of a module" -...
Read more >
JavaScript modules - MDN Web Docs
This guide gives you all you need to get started with JavaScript module ... Use of native JavaScript modules is dependent on the...
Read more >
Tree shaking completely broken? · Issue #2867 · webpack ...
Tree shaking is not removing imports, not used in the app. ... Tree shaking, removing not used imports. The test case is a...
Read more >
Using Native JavaScript Modules in Production Today
But now, thanks to some recent advances in bundler technology, it's possible to deploy your production code as ES2015 modules—with both static ...
Read more >
16. Modules
An ES6 module can pick a default export, the main exported value. Default exports are especially easy to import. The following ECMAScript 6...
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