Answer the question
In order to leave comments, you need to log in
Why doesn't react-scripts build add service-worker.js to the build?
Before that, I apparently used the older create-react-app, where build was created along with service-worker.js. Now I have registered serviceWorker.register() in index.js, but it is not in the build. If you transfer service-worker.js from builds of other applications to mine, then it starts to swear at the lack of precache-manifest.
Answer the question
In order to leave comments, you need to log in
Created another app with cra-template-pwa template. Further from it I transferred the serviceWorkerRegistration.js and service-worker.js files to my project. Added the serviceWorkerRegistration.register() line to index.js instead of serviceWorker.register(). Now it's working!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question