silviolleite / laravel-pwa

Looks like an app, feels like an app, but IS NOT an app.
MIT License
962 stars 154 forks source link

Laravel and vuejs #45

Open sanaderi opened 4 years ago

sanaderi commented 4 years ago

Is possible use this package with laravel and vuejs? I try use that in my vue/laravel project but dont work

CirkaN commented 4 years ago

What's the issue?

leganz commented 4 years ago

@sanaderi you might need to change the paths in the serviceworker.js file?

archmaster01 commented 3 years ago

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.

leganz commented 3 years ago

I think one requirement for service worker is a valid https connection... you might use expose to achieve this on local machines