jakearchibald / idb-keyval

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find module 'safari-14-idb-fix/dist/cjs-compat'

mrcnski opened this issue · comments

    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

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:

  1. remove the Rollup configuration in idb-keyval that pre-resolves safari-14-idb-fix, leaving imports as simply "safari-14-idb-fix".
  2. switch safari-14-idb-fix to use safari-14-idb-fix/dist/cjs-compat.js as its filename instead of safari-14-idb-fix/dist/cjs-compat/index.cjs

I have PR'd the second half of the fix at jakearchibald/safari-14-idb-fix#8