DEV Community

Discussion on: Handling Service Worker updates in your Vue PWA

Collapse
 
milindsingh profile image
Milind Singh

In my blog this updated(registration) method is called on every page reload and it show in console that 'New content is available; please refresh.'

Is this usual for PWA or I missed something ?

updated(registration) {
  console.log('New content is available; please refresh.')
  document.dispatchEvent(
    new CustomEvent('swUpdated', { detail: registration })
  )
}
Enter fullscreen mode Exit fullscreen mode

dev.adapttive.com

Collapse
 
drbragg profile image
Drew Bragg

Hey Milind, that doesn't sound right to me. Did you follow the above example exactly?

Collapse
 
milindsingh profile image
Milind Singh

Yes, I found the issue.

I had add the onesignal sdk for notifications, which has a service worker causing conflit with default website service worker. 🙂