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

Package.json type: "module" #124

Closed
philholden opened this issue Sep 5, 2021 · 2 comments
Closed

Package.json type: "module" #124

philholden opened this issue Sep 5, 2021 · 2 comments

Comments

@philholden
Copy link
Contributor

Had the following build error when using idb-keyval with sveltekit and adapter-cloudflare-worker.

(node:51281) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
> Cannot use import statement outside a module
/Users/holdph/personal/song-kit/node_modules/idb-keyval/dist/esm/index.js:1
import safariFix from 'safari-14-idb-fix';
^^^^^^

I added "type": "module", to the package.json of node_modules for both idb-keyval and safari-14-idb-fix and that allows me to build locally.

@philholden
Copy link
Contributor Author

@jakearchibald
Copy link
Owner

Thank you for this! Fixed version published as 5.1.4.

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

2 participants