Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot reload on server caused No Firebase App has been created #1596

Open
praburangki opened this issue Jan 22, 2025 · 0 comments
Open

Hot reload on server caused No Firebase App has been created #1596

praburangki opened this issue Jan 22, 2025 · 0 comments

Comments

@praburangki
Copy link

Reproduction

https://github.com/praburangki/vuefire/tree/issue/session-cookie

Steps to reproduce the bug

I've forked this repo and put it in a different branch issue/session-cookie.
I'm trying to build a repository pattern where I want to centralized my API calls.
In order to call these repos I need to put it in a nuxt plugin. These API calls will be needed either in server side & client side.

I also have a backend in the server folder to define my endpoints. While developing within the server, all works perfectly fine including the hot reload. The issue rises when the user is logged in.

Here are the steps to reproduce:

  1. Go to authentication page
  2. Click Signin Google (popup)
  3. Login
  4. Go to one of the files in the server folder and do some minor changes (e.g. adding console.log) and save it
  5. Refresh the page

Expected behavior

I did a check in Nuxt's devtools in the plugins sections I can see all of the vuefire plugins is already loaded then it's loading my API repository plugin. Within those vuefire plugins it's already calling initializeApp()

Actual behavior

You will get an error: "Firebase: No Firebase App '[DEFAULT]' has been created - call initializeApp() first (app/no-app)".

The workaround that I did is open chrome devtools, go to cookies and delete the __session cookie. Refresh the page and the error is gone.

Yes I do have the service-account.json file.

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant