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

es6 build needs to use mjs file extension or specify "type": "module" in a parent package.json file. #15

Open
segevfiner opened this issue Aug 29, 2023 · 0 comments

Comments

@segevfiner
Copy link

segevfiner commented Aug 29, 2023

Without this, more strict bundlers and Node's ESM mode won't be able to import the es6 build of jscrypto.

e.g. From vitest:

SyntaxError: Cannot use import statement outside a module
Module .../node_modules/.pnpm/[email protected]/node_modules/jscrypto/es6/lib/random.js:1 seems to be an ES Module but shipped in a CommonJS package. You might want to create an issue to the package "jscrypto" asking them to ship the file in .mjs extension or add "type": "module" in their package.json.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant