Open martindufresne opened 4 years ago
Same issue for me
Fix below:
--- a/resources/views/modules/laravelpwa/meta.blade.php
+++ b/resources/views/modules/laravelpwa/meta.blade.php
@@ -34,7 +34,7 @@
// Initialize the service worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/serviceworker.js', {
- scope: '.'
+ scope: '/'
}).then(function (registration) {
// Registration was successful
console.log('Signage Lab PWA: ServiceWorker registration successful with scope: ', registration.scope);
For me it did not work locally but worked on production.
For me it was because some files were not cached because they were missing. In your Developer Toolbar, go to Network and check if there are no errors. Then comment them in your serviceworker.js.
same problem here, I test with scope / and . and only in production works :(
same problem here, I test with scope / and . and only in production works :(
does it work for you using '.' on production? for me, it works on localhost but it doesnt in production :( heeelp
Fix below:
--- a/resources/views/modules/laravelpwa/meta.blade.php +++ b/resources/views/modules/laravelpwa/meta.blade.php @@ -34,7 +34,7 @@ // Initialize the service worker if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/serviceworker.js', { - scope: '.' + scope: '/' }).then(function (registration) { // Registration was successful console.log('Signage Lab PWA: ServiceWorker registration successful with scope: ', registration.scope);
got this by googling the whole day. Thanks a lot, @paulchiu for posting
@paulchiu Thank you! This should be by default as I spent a lot of time debugging why it wasn't working 😝
On Laravel 10, its the filesToCache
array, I removed app.css and app.js.
When I try to check if everything is working, I get this error. Yet everything seems ok. Someone had this problem? And if so, does anyone have a track to fix that? Thank you in advance!