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
Content not updating after refresh #10
Comments
Hi @preetamslot , I have patched the fix for the bug, let me know if it fixes the bug for you. |
Hello @rishabh3112 I don't think it worked, I just published now but the page does not automatically reload. Is it possible to configure the plugin without using a service worker too? |
Hi @Edmund1645 , This issue isn't same as your query. P.S. Meanwhile, If you want your suggestion to land quick, open a issue so that we can discuss what canbe done for development build and I will help you to land a PR for this. |
@rishabh3112, have updated to the latest version, cleared storage etc. its till gives me the same message :( |
Can you share the service worker that is generated? |
@rishabh3112
|
Cool, will look into this soon. |
There is a workaround which forces the service worker to skip waiting without triggering the event. In your module.exports = function(api) {
// some code before....
api.afterBuild(() => {
const outDir = api._app.config.outputDir;
let swPath = '';
for (const plugin of api._app.plugins._plugins) {
if (plugin.api._entry.use === 'gridsome-plugin-pwa') {
swPath = path.join(outDir, plugin.api._entry.options.serviceWorkerPath);
break;
}
}
let swFile = fs.readFileSync(swPath, 'UTF-8');
swFile += '\n\nworkbox.core.skipWaiting()';
fs.writeFileSync('./dist/service-worker.js', swFile);
});
// some code after....
}; This just appends a new line to the It would be a good thing for the plugin to pass config params to the |
@exreplay the "path" in |
@preetamslot it refers to the built in node package |
How can I force the app to download the content and reload the page?
now I see the message "New content is available; please refresh." and refreshing the page wont affect that.
The text was updated successfully, but these errors were encountered: