Open LjuAdmir opened 4 years ago
I figured out that the issue is the fact I'm deploying it all via cPanel and how everything is set up, apache doesn't server files from the /public/ root, I was wondering can the serviceworker.js be moved anywhere else?
The error is with '/offline' path set in serviceworker.js
:
var filesToCache = [ '/offline', ... ];
This happens because you have to set up a new route for /offline
path in routes/web.php
like this:
Route::get('/offline', function () { return view('vendor/laravelpwa/offline'); });
I get this type error how ti fix this issue
Laravel PWA: ServiceWorker registration failed: DOMException: Failed to register a ServiceWorker for scope ('http://localhost/laravel/ez-store/') with script ('http://localhost/laravel/ez-store/public/serviceworker.js'): The path of the provided scope ('/laravel/ez-store/') is not under the max scope allowed ('/laravel/ez-store/public/'). Adjust the scope, move the Service Worker script, or use the Service-Worker-Allowed HTTP header to allow the scope.
For a company we I work for, I tried to deploy this project and I get this error in the console (url redacted):
Laravel PWA: ServiceWorker registration failed: TypeError: "ServiceWorker script at https://<url>/serviceworker.js for scope https://<url>/ encountered an error during installation."