Reputation: 198
I'm using create react app and recently added a service worker so as to make it a PWA. It was very easy and seemed to work great. However, now whenever I build a new version of my app I get the following error on the initial load of the website:
I believe the problem is that when I build my app the file names are randomly generated and don't match the old ones. The PWA is using the old index.html trying to fetch the old files which don't exist anymore.
What is the best way of fixing this?
Upvotes: 0
Views: 2689
Reputation: 198
It turns out that the js file is too large to be precached. There are two approaches to solving the problem:
You can read more in this StackOverflow answer: Create React App serviceworker is not including one of the generated files
Upvotes: 4