Skip to content

nuxt SSR routes with auth enabled, not working in app hosting #1636

@OliverJEvans

Description

@OliverJEvans

Reproduction

https://github.com/OliverJEvans/firebase-test

Steps to reproduce the bug

  1. Clone barebones test repo
  2. Install deps
  3. Link to a Firebase project with at least app hosting setup (Blaze plan required)
  4. Build & Deploy
  5. Observe 500 error

/ssr route throws a 500
/csr renders fine.

Visit this project as example:
https://my-web-app--testproject-31cc4.europe-west4.hosted.app/ssr <!-- server side rendered
https://my-web-app--testproject-31cc4.europe-west4.hosted.app/csr <!-- client side rendered

Expected behavior

SSR routes should be built and accessible when auth is enabled.

Actual behavior

500 error on all SSR routes

The default Firebase app does not exist. Make sure you call initializeApp() before using any of the Firebase services.

Disabling auth and redeploying clears this issue.

Cloud Build logs report:

[warn] [nuxt-vuefire module] You activated both SSR and auth but you are not providing a service account for the admin SDK. See https://vuefire.vuejs.org/nuxt/getting-started.html#configuring-the-admin-sdk.

Which I would assume is saying the build can't find the service account.

Additional information

This codebase was setup from scratch using the official vuefire documentation, using a fresh Firebase project.

Perhaps the documentation here is out of date, missing something, or this is a bug? I found it suspicious, however, that there is this discussion from yesterday #1592. I thought it be appropriate to set up a bare bones reproduction.

I appreciate this may not be a Vuefire specific issue, but I would greatly appreciate any help or pointers in the right direction here as I've been looking at this all day.

Nuxt: 4.0.3
Vuefire: 3.2.2
nuxt-vuefire: 1.1.0
Firebase: 12.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions