Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto update doesn't work #493

Open
nirberko opened this issue Dec 2, 2020 · 0 comments
Open

Auto update doesn't work #493

nirberko opened this issue Dec 2, 2020 · 0 comments

Comments

@nirberko
Copy link

nirberko commented Dec 2, 2020

Hey,
For some reason auto updating doesn't working for me. after deploying a new version.

this is my configuration:

    new OfflinePlugin({
      updateStrategy: 'changed',
      autoUpdate: 5000,

      ServiceWorker: {
        events: true,
        navigateFallbackURL: '/'
      }
    })

And this is what I entered in my index.ts file:

OfflinePluginRuntime.install({
  onUpdating: () => {
    console.log('SW Event:', 'onUpdating');
  },
  onUpdateReady: () => {
    console.log('SW Event:', 'onUpdateReady');
    // Tells to new SW to take control immediately
    OfflinePluginRuntime.applyUpdate();
  },
  onUpdated: () => {
    console.log('SW Event:', 'onUpdated');
    // Reload the webpage to load into the new version
    window.location.reload();
  },
  onUpdateFailed: () => {
    console.log('SW Event:', 'onUpdateFailed');
  }
});

when opening the app in another tab it indeed updating the chunks and im getting the logs in my primary tab. but im not getting any auto updating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant