You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System version: macOS Big Sur 11.5.1 (20G80)
Firebase SDK version: 9.0.2
Firebase Product: database
Node.js version: 16.7.0
NPM version: 7.20.3
Yarn version: 1.22.11
The problem
After the installation to the Next.js (v10.0.5) environment the project compiling fails with an error:
error - ./node_modules/firebase-admin/node_modules/@firebase/database/dist/index.esm.js
Attempted import error: '@firebase/app' does not contain a default export (imported as 'firebase').
I was only able to 'fix' it by changing import firebase from '@firebase/app' to import * as firebase from '@firebase/app' in ./node_modules/firebase-admin/node_modules/@firebase/database/dist/index.esm.js.
Is that the firebase-admin obsolete dependency issue?
Steps to reproduce:
Install the firebase-admin to the Next.js project: yarn add firebase-admin;
Run next dev server: yarn dev;
See that it won't compile because of the following error:
error - ./node_modules/firebase-admin/node_modules/@firebase/database/dist/index.esm.js
Attempted import error: '@firebase/app' does not contain a default export (imported as 'firebase').
The text was updated successfully, but these errors were encountered:
We accidentally removed the export that the admin SDK uses in v9, and removed the condition that prevent @firebase/app from being evaluated when used in the admin SDK. I will add them back.
Before the fix is released, the admin SDK has to use @firebase/database version 0.11.x or below. You will need to manually remove /node_modules/firebase-admin/node_modules/@firebase/database, and install a compatible @firebase/database version. It can become complicated if you are also using the firebase package because of package hoisting.
I can make an emergency release, so it may be better to just wait for the fix in the next firebase release.
Environment
The problem
After the installation to the Next.js (v10.0.5) environment the project compiling fails with an error:
I was only able to 'fix' it by changing
import firebase from '@firebase/app'
toimport * as firebase from '@firebase/app'
in./node_modules/firebase-admin/node_modules/@firebase/database/dist/index.esm.js
.Is that the
firebase-admin
obsolete dependency issue?Steps to reproduce:
yarn add firebase-admin
;yarn dev
;The text was updated successfully, but these errors were encountered: