You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also have a .env file where those environment variables are spelled out, as well as setting GOOGLE_APPLICATION_CREDENTIALS to the admin key.
For firebase.services.auth.ssr.credential, I've tried both true and a full path to the credential file. In my testing, removing firebase.services.auth.ssr.serverLogin allows the app to build properly, but the admin credentials are not used on the server side when loading data.
What is Expected?
I'm running an app that uses Firebase Auth to make sure that the person logging in is authorized to see the data, and then Realtime DB to fetch/store the data. Right now the rules are set so everyone has read access and no one has write access (a separate console app with the admin SDK writes to the database). I want to use server-side authentication following this guide but changing firebase.services.auth.ssr from true to { credential: true, serverLogin: true } causes a webpack error during the build (exact error below).
What is actually happening?
Receive this console error:
✖ Client
Compiled with some errors in 6.74s
✔ Server
Compiled successfully in 3.92s
ERROR Failed to compile with 1 errors friendly-errors 14:55:15
ERROR in ./node_modules/@nuxtjs/firebase/lib/utils/auth-ssr/ssr-auth-session-manager.js friendly-errors 14:55:15
Module parse failed: Unexpected token (113:57) friendly-errors 14:55:15
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| const instance =
> this.firebase.apps.find((a) => a.name === name) ??
| this.firebase.initializeApp(this.config, name)
|
friendly-errors 14:55:15
@ ./.nuxt/firebase/app.js 39:19-92
@ ./.nuxt/firebase/index.js
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi ./node_modules/eventsource-polyfill/dist/browserify-eventsource.js (webpack)-hot-middleware/client.js?reload=true&timeout=30000&ansiColors=&overlayStyles=&path=%2F__webpack_hmr%2Fclient&name=client ./.nuxt/client.js
The text was updated successfully, but these errors were encountered:
Did some further testing with an isolated repo that I could share (rather than one filled with my app-specific pages). Tested using both node 14 and 16 (the linked repo has a .nvmrc file pinning to 16.something) in case it was a weird artifact of my node version, still same error as before.
Version
@nuxtjs/firebase: 8.2.2
firebase: 9.9.2
nuxt: 2.15.8
Reproduction Link
Repo with minimal code
Steps to reproduce
Error occurs running
nuxt dev
.nuxt.config.js:
Also have a
.env
file where those environment variables are spelled out, as well as settingGOOGLE_APPLICATION_CREDENTIALS
to the admin key.For
firebase.services.auth.ssr.credential
, I've tried bothtrue
and a full path to the credential file. In my testing, removingfirebase.services.auth.ssr.serverLogin
allows the app to build properly, but the admin credentials are not used on the server side when loading data.What is Expected?
I'm running an app that uses Firebase Auth to make sure that the person logging in is authorized to see the data, and then Realtime DB to fetch/store the data. Right now the rules are set so everyone has read access and no one has write access (a separate console app with the admin SDK writes to the database). I want to use server-side authentication following this guide but changing
firebase.services.auth.ssr
fromtrue
to{ credential: true, serverLogin: true }
causes a webpack error during the build (exact error below).What is actually happening?
Receive this console error:
The text was updated successfully, but these errors were encountered: