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

onFirebaseHosting set to true throws error in development #379

Closed
2 tasks
lupas opened this issue Nov 10, 2020 · 1 comment
Closed
2 tasks

onFirebaseHosting set to true throws error in development #379

lupas opened this issue Nov 10, 2020 · 1 comment
Assignees
Labels
all-clear Everything is clear - can be worked on bug Something isn't working

Comments

@lupas
Copy link
Member

lupas commented Nov 10, 2020

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:

  • Document this better in the documentation
  • Fix the module so the service-worker always uses gstatic in development (preferred)
@lupas lupas self-assigned this Nov 10, 2020
@lupas lupas added feature New feature or request all-clear Everything is clear - can be worked on labels Nov 10, 2020
lupas added a commit that referenced this issue Dec 22, 2020
@lupas lupas added bug Something isn't working and removed feature New feature or request labels Dec 22, 2020
@lupas
Copy link
Member Author

lupas commented Dec 22, 2020

Fixed, next release coming soon.

@lupas lupas closed this as completed Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
all-clear Everything is clear - can be worked on bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant