firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.82k stars 885 forks source link

Service auth is not available #8506

Open jdgamble555 opened 23 hours ago

jdgamble555 commented 23 hours ago

Operating System

Windows 11

Environment (if applicable)

Vercel Edge with Qwik

Firebase SDK Version

10.13.1-canary.16d62d4fa (or lower)

Firebase SDK Product(s)

Auth

Project Tooling

Qwik (1.8.0)

Detailed Problem Description

When I use getAuth() on the server inside a Qwik app, I get the Service Auth is not available error. The local testing environment has no problems and works as expected.

It is literally something that gets errored out in Qwik with getAuth().

Possibly related to #8355

While I'm not sure why the error is thrown, it is coming from here: https://github.com/firebase/firebase-js-sdk/blob/629919ea760e35b7d880a099edf7f42b5bcbae4b/packages/component/src/provider.ts#L130

J

Steps and code to reproduce issue

I made a Repo:

  1. Add your Firebase environment variables to .env and to Vercel Edge environment variables.

    PUBLIC_FIREBASE_CONFIG={"apiKey":....,"authDomain"...}
  2. Deploy to Vercel Edge.

  3. Sign in with Google.

  4. Click the about link in navigation.

  5. See error thrown.

See Deployed Demo with error.

If have isolated the error to getAuth(). This app doesn't use initializeApp or initializeServerApp, but the error is the same in either case.

Here is failing code.

J

google-oss-bot commented 23 hours ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.