Skip to content

Error in firebase-admin dependency: '@firebase/app' does not contain a default export (imported as 'firebase'). #1434

@taletski

Description

@taletski

Environment

  • 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:

  1. Install the firebase-admin to the Next.js project: yarn add firebase-admin;
  2. Run next dev server: yarn dev;
  3. 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').

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions