-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Service Worker breaks the app in Firefox #6686
Comments
I managed to repro, though it took modifying-building-serving a few times. I think the issue is workbox trying to load old resources. There are some other old issues in the tracker about similar things. I'm honestly not sure, but it may be fixed if #6725 lands. If I have time this weekend I'll try to repro on a branch with that pr to definitively say. |
@heyimalex: I had a similar issue with v3! When the resources change, workbox deletes the older resources from it's cache. So on the rare occasions where it tries to load the old resource (which does happen now and then), it crashes, because that resource does not exist. There is an option to skip the clean up in v4 using the flag I suggest making a copy of your app with the issues, temporarily ejecting the copy, then changing the version of the |
Trying to fix this issue facebook/create-react-app#6686 However vue cli still uses workbox v3
It's fine in CRA 3.0.1, I've implemented service worker and it's working as expected in Firefox and other browsers too. Closing the issue :-) |
Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes, I've tried it on fresh installed app
Which terms did you search for in User Guide?
service worker, progressive web app
Environment
macOS Mojave (10.14.3), Firefox 66.0 (65.0 worked same), current 2.1.8 react-scripts
Steps to Reproduce
index.js
- instead ofserviceWorker.unregister()
callserviceWorker.register()
yarn run build
serve -s -l 3000 build
localhost:3000
in FirefoxApp.js
yarn run build
againExpected Behavior
New service worker should be installed and in waiting state
Actual Behavior
It throws error in console and service worker isn't updated:
When I unregister service worker from Firefox and refresh the tab, it's again working for first time - then you refresh the tab (immediately) for the second time and it again throws the same error in console and also crashes (doesn't display the app) with another error in console:
The text was updated successfully, but these errors were encountered: