vite-plugin-pwa icon indicating copy to clipboard operation
vite-plugin-pwa copied to clipboard

Unable to have `devOptions.enabled` set to `true` working on Laravel

Open feryardiant opened this issue 1 year ago • 1 comments

Hi,

Currently I'm working on a laravel project and so far everything's working just fine except one thing, I want to have this plugin to work on development but unable to make it happen due to the /dev-sw.js file is refer to APP_URL instead of vite dev URL.

SW registration failed:  TypeError: Failed to register a ServiceWorker for scope ('https://skeleton.creasi.local/') with script ('https://skeleton.creasi.local/dev-sw.js?dev-sw'): A bad HTTP response code (404) was received when fetching the script.

But when I try to access the dev-sw.js using vite dev URL (https://skeleton.creasi.local:5173/dev-sw.js?dev-sw).

Screenshot 2023-12-22 at 23 13 02

Is it possible to load the dev-sw using vite dev URL?

feryardiant avatar Dec 22 '23 16:12 feryardiant

The same issue occurs with the web manifest file. It appears that the generated URLs do not include the server port.

slavarazum avatar Jun 25 '24 23:06 slavarazum