Package.json type: "module"
philholden opened this issue · comments
Phil Holden commented
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.
Phil Holden commented
Jake Archibald commented
Thank you for this! Fixed version published as 5.1.4.