jakearchibald / idb-keyval

A super-simple-small promise-based keyval store implemented with IndexedDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Package.json type: "module"

philholden opened this issue · comments

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.

Thank you for this! Fixed version published as 5.1.4.