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

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

Open
mrcnski opened this issue Sep 13, 2021 · 2 comments
Open

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

mrcnski opened this issue Sep 13, 2021 · 2 comments

Comments

@mrcnski
Copy link

mrcnski commented Sep 13, 2021

    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

@developit
Copy link

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

@developit
Copy link

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

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