Open rlw87 opened 1 month ago
I used the Development Tool to "Update on reload" which fixed the refresh issue, but that isn't a setting I can have my users change.
Any luck with solving this?
Hey @ESRuth, would you able to resolve this issue? Thanks
I've just included the firebase config in the service worker itself, rather than having the app pass it the config when it's installed. None of the values should change so I don't see why it should be a problem.
I am experiencing problems with the service worker, which fails upon page reload, sometimes after a few hours, or when the page is opened in a new browser tab.
Having the same problem. Didn't clone the friendlyeats project, I copy pasted the auth code into my Next.js proiect and I have the same issue with the service worker. Still searching for a permanent solution.
Having the same issue here as well. Hardcoding the values stops it from crashing however, obviously this is not ideal.
Description If the auth service worker is restarted, it loses the firebaseConfig options that it was given at registration time and throws an exception.
Reproduction Steps
Expected The service worker starts up again and the website loads as normal
Actual You see the following error in the console and the page doesn't load
I'm new to working with service workers so I might be missing something, but it looks to me as though the service worker should be storing the firebaseConfig somewhere other than in memory, so it can be reloaded on restart of the service worker. It looks like due to the firebaseConfig variable only being populated on 'install' event, it will never get the required configuration again unless you either manually unregister it and let it re-install, or it is updated to a newer version.
https://github.com/firebase/friendlyeats-web/blob/41b0a4dbfca6c106d926fd5e65db53577f99ea75/nextjs-end/auth-service-worker.js#L6C5-L6C19