Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7.0.0 esm import problem #129

Closed
zdm opened this issue Nov 26, 2021 · 1 comment · Fixed by #130
Closed

v7.0.0 esm import problem #129

zdm opened this issue Nov 26, 2021 · 1 comment · Fixed by #130
Labels

Comments

@zdm
Copy link

zdm commented Nov 26, 2021

import geotz from "geo-tz"

Error:

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1026:15)
    at Module._compile (node:internal/modules/cjs/
....

You need to:

  1. rename geo-tz.modern.js to geo-tz.modern.mjs
  2. or add "type": "module" to the package.json and rename geo-tz.js to geo-tz.cjs;
  3. update extensions in package.json exports;
evansiroky added a commit that referenced this issue Nov 27, 2021
Fixes #129

microbundle is not happy with the mixing of default and named exports. It seems the easiest thing to do here is make the default export a named export.

This is probably a breaking change from v7.0.0, but since it was released not long ago and not really working all that well anyways, I'm just calling this a fix and assuming this named export thing should've been a breaking change that landed in v7.0.0.

This is probably a violation of SEMVER in a strict sense, so I apologize to anyone who already made workarounds for what was in v7.0.0.
@evansiroky
Copy link
Owner

🎉 This issue has been resolved in version 7.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants