Receiving " Firebase: No Firebase App '[DEFAULT]' has been created", even though it has been created #373
-
I'm receiving the following error on my project, even though not much is different from the example project. One thing that I made a change to was the import statement in Does anyone have any ideas or suggestions? Maybe I'm missing something, i figured since initAuth is being called in _app.tsx, then firebase should be initialized. Could this be because I'm importing firebase/app/compact? _app.tsx import '../styles/globals.css'
import initAuth from '../service/auth/initAuth'
import type { AppProps } from 'next/app'
initAuth()
function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
export default MyApp api/logout.ts File Structure:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
Here's my package.json {
"name": "dashboard",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@emotion/react": "^11.7.0",
"@emotion/styled": "^11.6.0",
"@mui/icons-material": "^5.2.1",
"@mui/material": "^5.2.3",
"dotenv": "^10.0.0",
"firebase": "^9.6.1",
"firebase-admin": "^10.0.1",
"next": "^12.0.7",
"next-firebase-auth": "^1.0.0-canary.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-firebaseui": "^6.0.0",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^2.0.4"
},
"devDependencies": {
"@types/node": "16.11.12",
"@types/react": "17.0.37",
"eslint": "8.4.1",
"eslint-config-next": "12.0.7",
"typescript": "4.5.3"
}
} |
Beta Was this translation helpful? Give feedback.
-
My suspicion is that you need to update how you're getting the auth app for Firebase v9 where you're passing it to Firebase UI. Remove Firebase compat, then rather than |
Beta Was this translation helpful? Give feedback.
-
@kmjennison Hello, I am trying to upgrade to Firebase 9.x as well. I am still calling
I am using It should be initializing the app here: and if I call |
Beta Was this translation helpful? Give feedback.
My suspicion is that you need to update how you're getting the auth app for Firebase v9 where you're passing it to Firebase UI. Remove Firebase compat, then rather than
firebaseAuth={firebase.auth()}
, usefirebaseAuth={getAuth(getApp())}
. See v1.x example.