nuxt-community / firebase-module

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

Cannot read property 'includes' of null at firebase-auth-sw.js:62 #515

Closed stijns96 closed 3 years ago

stijns96 commented 3 years ago

Hi all,

I'm getting this error...

image image

Also i'm getting a red cross after my sw.js

image

I am trying to create a ssr pwa with firebase auth and basically everything works, but I really wonder why I am getting these errors. In my opinion, errors are never good and I cannot find anything about them on the internet.

Is anyone familiar with this? Please let me know if info or code is required!

tibs245 commented 3 years ago

You sent probability a request with no headers accept parameter.

The websocket intercept this request and enter in this error

We need probabily add :

  let expectsHTML = false 
  if (Array.isArray(event.request.headers.get('accept')))
     expectsHTML= event.request.headers.get('accept').includes('text/html') 

to firebase-auth-sw.js template

Or you can find this request and add headers with accept parameter.

lupas commented 3 years ago

Closing due to inactivity.