pwa-module
pwa-module copied to clipboard
start_url does not respond with a 200 when offline
I'm using @nuxtjs/pwa "3.3.5" with nuxt "2.14.12". I ran the projecct with nuxt build; nuxt start (my build directory is: .build) and I'm using Nginx for local url redirection.
My config looks like:
icon: {
iconFileName: "icon.png",
},
manifest: {
name: "MyAppName",
lang: "frFR",
short_name: "AppName",
start_url: "/?standalone=true",
display: "standalone",
background_color: "#f8f8f8",
theme_color: "#f8f8f8",
description: "My simple PWA app",
icons: [],
},
},
When I run a lighthouse test I get the following errors in pwa module:

Can anyone tell me what's the wrong with my config?
Hi @fahdaddi. Can you please try by removing start_url option? (also i assume there is no workbox options in nuxt.config)
Update: I can see url scheme is http. Service workers only work with trusted origins (localhost and https)
Hey @pi0, for the workobxI found that all I need is default values? is there any vars that I should add ?
Update: I can see url scheme is
http. Service workers only work with trusted origins (localhost and https)
I'll try to add a local SSL certificate to test it with https
What I found is that self signed SSL is not going to be enough. Chrome will still complain that it is an insecure page and will not load sw.js file.
My solution is to run Chrome with the following flags from the command prompt on windows:
\'Program Files'\Google\Chrome\Application\chrome.exe --ignore-certificate-errors --unsafely-treat-insecure-origin-as-secure=https://localhost/
Hope this helps