I have stumbled across this article and tried proposed solution and it partialy worked for me.
Firebase loads fine, no error. idb doesn't load and 'npm run dev' throws me this error:
✗ client
'deleteDb' is not exported by node_modules\idb\build\idb.js
4: import { __values, __spread, __awaiter, __generator, __assign } from 'tslib';
5: import { ErrorFactory } from '@firebase/util';
6: import { deleteDb, openDb } from 'idb';
^
7:
8: /**
I have this in my rollup.config.js:
commonjs({
namedExports: {
// left-hand side can be an absolute path, a path
// relative to the current directory, or the name
// of a module in node_modules
'node_modules/idb/build/idb.js': ['deleteDb', 'openDb'],
'idb': ['deleteDb', 'openDb'],
'node_modules/firebase/dist/index.cjs.js': ['initializeApp', 'firestore', 'auth', 'analytics' ],
'node_modules/firebase/app/dist/index.esm.js': ['initializeApp', 'firestore', 'auth', 'analytics' ],
//'node_modules/firebase/app/dist/index.cjs.js': [],
//'node_modules/firebase/auth/dist/index.cjs.js': ['auth'],
//'node_modules/firebase/analytics/dist/index.cjs.js': ['analytics']
},
})
EDIT: I've found out that reverting firebase from version 7.7.0 to 6.5.0 has solved this problem. Although this is not a fix I would want but will work for now.