You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 are unregistered 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 following
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 .unregister() in the MSW documentation as a good default.
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.
Activity
kettanaito commentedon Aug 31, 2020
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
.unregister()in the MSW documentation as a good default.marcosvega91 commentedon Aug 31, 2020
There are new templates
cra-template-pwaandcra-template-pwa-typescriptwithserviceWorkerscriptstale commentedon Oct 4, 2020
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.
stale commentedon Oct 12, 2020
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.