laravel-pwa
laravel-pwa copied to clipboard
Laravel and vuejs
Is possible use this package with laravel and vuejs? I try use that in my vue/laravel project but dont work
What's the issue?
@sanaderi you might need to change the paths in the serviceworker.js file?
I´m also trying to implement this package on a Laravel 8.31.0 using Vue 3.07, but the serviceworker never runs. I´ve track the issue to this line on the script @ app.blade.php:
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/serviceworker.js', {
scope: '.' ...
but if I console.log(navigator), it doesn´t have a 'serviceworker' key or attribute and there´s no else{} clause to this if(), so the serviceworker.js file never gets called. Any suggestions will be very valuable. Txs!
Edit: Nevermind, it only happens in local environment. It´s loaded fine in production.
I think one requirement for service worker is a valid https connection... you might use expose to achieve this on local machines