angular / angular/angularfire

"No Firebase App '[DEFAULT]' has been created" when using " provideFirebaseApp(() => initializeApp(environment.firebase))," in app.module.ts imports array, getStorage()

Open
#3,443 21 comments 1 reaction 0 assignees View on GitHub
comp: storage needs: investigation type: bug version: legacy (v7-v16)
Dominant language
TypeScript
Stars
7.8k
Forks
2.2k
Avg merge
22h 28m
Merged PRs (30d)
6

Description

### Version info

**Angular:**
^16.2.0

**Firebase:**
^10.4.0

**AngularFire:**
^7.6.1

**Other (e.g. Ionic/Cordova, Node, browser, operating system):**

### How to reproduce these conditions

**Steps to set up and reproduce**
Create Angular app via ng new appName, add Angularfire with ng add @angular/fire, initialize Firebase app in app.module.ts using the following in the imports array:

` provideFirebaseApp(() => initializeApp(environment.firebase)),
`
Then, integrate firebase app via environments (create with ng add environment if needed), add storage service that connects to storage bucket via getStorage()

### Debug output

ERROR Error: Uncaught (in promise): FirebaseError: Firebase: No Firebase App '[DEFAULT]' has been created - call initializeApp() first (app/no-app).
FirebaseError@http://localhost:4200/vendor.js:73648:5
create@http://localhost:4200/vendor.js:73676:19
getApp@http://localhost:4200/vendor.js:154432:25
getStorage@http://localhost:4200/vendor.js:72546:80
4886/ɵzoneWrap/

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in app.module.ts using provideFirebaseApp(() => initializeApp(environment.firebase)) and a storage service that calls getStorage(). Trace the initialization and service access order shown by the Firebase no-app stack trace. Done means the storage service works without the default-app error.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, firebase, typescript
Domain
cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.