DEV Community

Discussion on: Let Users Know When You Have Updated Your Service Workers in Create React App

Collapse
 
manuelurbanotn profile image
manuelurbanotn

Hello Gert, nice post!
I'm working with a legacy app with and older version of CRA.
Can you share the workaround for older versions you mentioned before?

Collapse
 
glukmann profile image
Gert Glükmann

Hi!
You have create another file where you add the eventListener for message yourself (as shown in one of the gists) and then append that file to created service worker on build time. This can be done for example with github.com/tszarzynski/cra-append-sw.
Let me know if you have any troubles.

Collapse
 
manuelurbanotn profile image
manuelurbanotn

Hi Gert!
Finally I noticed that my app has Workbox integrated to Webpack, so I fixed it adding skipWaiting: true on my Webpack config.

Thanks for your time!

Thread Thread
 
niketsoni profile image
Niket Soni

Hey buddy! Thank you so much for your comment here. It worked for me like magic :)