Cannot find module 'safari-14-idb-fix/dist/cjs-compat'
mrcnski opened this issue · comments
Marcin S. commented
Cannot find module 'safari-14-idb-fix/dist/cjs-compat' from 'node_modules/idb-keyval/dist/compat.cjs'
Require stack:
node_modules/idb-keyval/dist/compat.cjs
scripts/permissions.ts
tests/permissions.test.ts
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
at Object.<anonymous> (node_modules/idb-keyval/dist/compat.cjs:9:17)
https://github.com/SkynetLabs/skynet-mysky/pull/47/checks?check_run_id=3587658175
Jason Miller commented
safari-14-idb-fix
won't load in Node < 12 and Jest because it relies on ./index.cjs
, which was never implemented.
There are two fixes, and the best solution here would be to implement both:
- remove the Rollup configuration in
idb-keyval
that pre-resolvessafari-14-idb-fix
, leaving imports as simply"safari-14-idb-fix"
. - switch
safari-14-idb-fix
to usesafari-14-idb-fix/dist/cjs-compat.js
as its filename instead ofsafari-14-idb-fix/dist/cjs-compat/index.cjs
Jason Miller commented
I have PR'd the second half of the fix at jakearchibald/safari-14-idb-fix#8