nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
641 stars 98 forks source link

onFirebaseHosting set to `true` throws error in development #379

Closed lupas closed 3 years ago

lupas commented 3 years ago

Problem

When setting onFirebaseHosting to true, the service workers try to load the Firebase JS SDK from the nuxt dev server from __/firebase/..., which of course does not exist. It throws the following error message:

Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:3333/__/firebase/8.0.1/firebase-app.js' failed to load.

Solution

Only set onFirebaseHosting to true in production like so: onFirebaseHosting: process.env.NODE_ENV === 'production'

ToDo

Either/or:

lupas commented 3 years ago

Fixed, next release coming soon.