jakearchibald / idb

IndexedDB, but with promises
https://www.npmjs.com/package/idb
ISC License
6.34k stars 357 forks source link

Firebase Warning: Original error: (0 , _idb.openDB) is not a function. (app/idb-get). #287

Open jayordway opened 1 year ago

jayordway commented 1 year ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch idb@7.0.1 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/idb/package.json b/node_modules/idb/package.json
index 22441fc..3c8b26d 100644
--- a/node_modules/idb/package.json
+++ b/node_modules/idb/package.json
@@ -2,7 +2,7 @@
   "name": "idb",
   "version": "7.0.1",
   "description": "A small wrapper that makes IndexedDB usable",
-  "main": "./build/index.cjs",
+  "main": "./build/index.js",
   "module": "./build/index.js",
   "types": "./build/index.d.ts",
   "exports": {

This issue body was partially generated by patch-package.

jakearchibald commented 1 year ago

Can you tell me a bit more about this error? My understanding is that "main" should point to the CommonJS version by default. I think this change would break other uses.