silviolleite / laravel-pwa

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

does not work in laravel 7 #49

Closed serome111 closed 3 years ago

serome111 commented 4 years ago

i have a problem with my code

once install and configured shows a problem in the manifest, errors and warnings

1 icon https://127.0.0.1:8000/images/icons/icon-72x72.png does no specify its size in the manifest 2 Shortcut #1 should include a 96x96 pixel icon 3 Icon src is not set 4 Shortcut #2 should include a 96x96 pixel icon

Installability

No matching service worker detected. you may need to reload the page, or check that the scope of the service worker for the current page encloses the scope and start.

but when I run the lighthouse show other problems

start_url does not respond with a 200 when offlineTimed out waiting for start_url (http://localhost:8000/) to respond.

Does not register a service worker that controls page and start_url Manifest doesn't have a maskable icon

when I go to the console it shows me

Laravel PWA: ServiceWorker registration successful with scope: http://localhost:8000/

serviceworker.js:1 Uncaught (in promise) TypeError: Request failed

i use this the tutorial

https://www.youtube.com/watch?v=4af3btW1foc

goodmuyis commented 4 years ago

What if you you edit /config/laravelpwa.php line 8 like this //'start_url' => '/' Change it to 'start_url' => env('APP_URL','')

If the it does not fix the error serviceworker.js:1 Uncaught (in promise) TypeError: Request failed Try to comment out some lines in the /public/serviceworker.js under the var filesToCache [ array You can start wit the line 4 and 5. if your app does not depend on them you should be fine.

    '/css/app.css',
    '/js/app.js',

The reason being that; I found out that if any of these line return 404 error it causes a javascript error which halt the serviceworker.js to progress

serome111 commented 4 years ago

@goodmuyis Thanks to you, I have been able to solve it, now I only have this warning

start_url does not respond with a 200 when offlineThe start_url did respond, but not via a service worker. Warnings: Lighthouse couldn't read the start_url from the manifest. As a result, the start_url was assumed to be the document's URL. Error message: 'ERROR: start_url must be same-origin as document'.

goodmuyis commented 3 years ago

If you are working offiline, try to use https and configure ssl for your local server. or upload the app online and test.

Also don't for get to test the /offline route to see if it is working well

serome111 commented 3 years ago

thank you for your help. works well, but there are some views where when I access them, it shows the offline view and I don't understand why this happens.

goodmuyis commented 3 years ago

thank you for your help. works well, but there are some views where when I access them, it shows the offline view and I don't understand why this happens.

The offline page is serve when network fail to respond quickly (i guess)

serome111 commented 3 years ago

Gracias por tu ayuda. funciona bien, pero hay algunas vistas en las que cuando accedo a ellas, se muestra la vista sin conexión y no entiendo por qué sucede esto.

La página fuera de línea se sirve cuando la red no responde rápidamente (supongo)

How can I change this behavior?

goodmuyis commented 3 years ago

Gracias por tu ayuda. funciona bien, pero hay algunas vistas en las que cuando accedo a ellas, se muestra la vista sin conexión y no entiendo por qué sucede esto.

La página fuera de línea se sirve cuando la red no responde rápidamente (supongo)

How can I change this behavior?

In my own opinion, there is nothing you can do because it is an issue between your server and the app. the only thing i can think of is if you can add a link or button for the users to reload the current page

serome111 commented 3 years ago

Gracias por tu ayuda. funciona bien, pero hay algunas vistas en las que cuando accedo a ellas, se muestra la vista sin conexión y no entiendo por qué sucede esto.

La página fuera de línea se sirve cuando la red no responde rápidamente (supongo)

¿Cómo puedo cambiar este comportamiento?

En mi opinión, no hay nada que pueda hacer porque es un problema entre su servidor y la aplicación. lo único que puedo pensar es si puede agregar un enlace o botón para que los usuarios recarguen la página actual

it doesn't work when I reload the page, it really tells me that I don't have an internet connection and shows me the offline template I have tried several things but I don't understand why it happens

goodmuyis commented 3 years ago

drop the link to the app if you can share the app publicly

serome111 commented 3 years ago

suelte el enlace a la aplicación si puede compartirla públicamente

I can share it but I would have to give you the role of admin to validate the error. this only happens as an admin

goodmuyis commented 3 years ago

suelte el enlace a la aplicación si puede compartirla públicamente

I can share it but I would have to give you the role of admin to validate the error. this only happens as an admin

If that is ok by you here is my public email ultramail2000-user1 [at] yahoo.com

serome111 commented 3 years ago

suelte el enlace a la aplicación si puede compartirla públicamente

Puedo compartirlo, pero tendría que darte el rol de administrador para validar el error. esto solo sucede como administrador

Si le parece bien, aquí está mi correo electrónico público ultramail2000-user1 [at] yahoo.com

this is the link to the page https://etclinegaming.com create a user and tell me the nick, I give you admin user roles.

goodmuyis commented 3 years ago

suelte el enlace a la aplicación si puede compartirla públicamente

Puedo compartirlo, pero tendría que darte el rol de administrador para validar el error. esto solo sucede como administrador

Si le parece bien, aquí está mi correo electrónico público ultramail2000-user1 [at] yahoo.com

this is the link to the page https://etclinegaming.com create a user and tell me the nick, I give you admin user roles.

github_i49

Some issues that i found on your website => Redirection problem on /dashboard route. You will need to check your Controller or Middleware

serome111 commented 3 years ago

/dashboard

what problem did you encounter en /dashboard? I already gave you access as admin, check the ad view on mobile no problem but from the pc yes

goodmuyis commented 3 years ago

Can you fix this two javascript errors, let us see what will happen. see the image => The first is the Invalid reCAPTCHA client id: => The second is the error from pusher: Error: We weren't granted permission.

You can disable them first so we can fix the PWA Js

serome111 commented 3 years ago

Eureca the problem was that there were routes with the same name and this caused the problem.

dieudonneopilam commented 2 years ago

merci beaucoup goodmuyis tu es le meilleur vraiment que le bon Dieu vous benisse