firebase / firebase/firebase-tools

The default Firebase app does not exist. Make sure you call initializeApp()

Open
#5,980 8 comments 4 reactions 2 assignees Claimed by @DellaBitta View on GitHub
integration: web frameworks needs-info type: question
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### Discussed in https://github.com/firebase/firebase-tools/discussions/5910

From [Geoffrey-Pliez](https://github.com/Geoffrey-Pliez):

> the script no longer passed in the firebase-frameworks/firebase-aware.

> [Here](https://stackblitz.com/edit/github-bi9q8b?file=src%2Fpages%2Findex.astro) is the minimal source code to reproduce the problem.

> When I test locally with the prod_preview command (set FIREBASE_FRAMEWORKS_BUILD_TARGET=production&& npm run emulators),
it works correctly and the code passes well in firebase-aware.

> When I deploy on the server (firebase hosting) via the firebase deploy command, it no longer works and get the message
[ssr] Error: The default Firebase app does not exist. Make sure you call initializeApp() before using any of the Firebase services.
and guess that on the server the firebase-aware script is no longer called.

> I'm not sure but I think it's since upgrading from 11.30.0 to 12.0.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.