-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
unregister only CRA service-worker #9566
Comments
I believe that the Service Worker script that came by default with Create React App has been removed and is no longer present in the newer installations. You can see the file structure included with the current template here (notice no Service Worker script). Not sure to which extend the CRA team can support here, it may be worth just mentioning the removal of |
There are new templates |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue. |
Describe the bug
CRA provides a script to use service worker. This script export a function to
unregister
it.This function is called, by default, in the
index
file of the template. On MSW SW is used to intercept http calls and mock them, but because of the SW areunregistered
on bootstrap it may cause some problem. Is this the correct behavior?Maybe CRA should only
unregister
his SW.The
unregister
function could be something like the followingExpected behavior
unregister
should remove only SW registered by CRA.We have an issue here
Actual behavior
unregister
is removing other SW.The text was updated successfully, but these errors were encountered: