quasarframework / quasar-cli

[DEPRECATED, <= 0.17) Quasar Framework - CLI
https://quasar.dev
MIT License
202 stars 50 forks source link

Service worker in subdirectory #142

Closed mardom1 closed 6 years ago

mardom1 commented 6 years ago

Hello, as #131 seems to be closed, I am creating a new issue.

Like the author of #131, I am deploying my PWA to a subdirectory on our server. In previous versions this worked perfectly fine after specifying the public path. But after updating to Quasar CLI v16 the public path is ignored for the service worker, so that the PWA is trying to load /service-worker.js instead of /publicPath/service-worker.js. This impacts greatly on user experience, with no offline functionality and updating.

131 was closed with the argument that it isn't possible due to browser restrictions, but as I said, it worked before and I can't deploy it to the server root as suggested.

I hope this gets fixed as I really like the framework.

dexif commented 6 years ago

Yes it's very important for us too!

nadezhdamosunova commented 6 years ago

+1

LeXXaT commented 6 years ago

+1

ibra-x347 commented 6 years ago

+1

toh8xi commented 6 years ago

+1

janlycka commented 6 years ago

+1

I've been struggling with the very same issue. Moreover, it would make more sense for anyone to deploy PWAs in non-root directories by default, e.g. https://example.com/pwa rather than https://example.com. Requiring to register a new domain for every app, as at present, is tiresome.

How come there are so few of us complaining?

rstoenescu commented 6 years ago

I triple checked this. Last time I did it, Chrome tried to get the service worker from root (even though the pwa config was flawless), not from the subfolder -- bug in browser. Will check again and see if they fixed it near the end of the week.

Btw, you can use subdomains.

dexif commented 6 years ago

Mmmm... But why on 15 version everything is ok? Just look into devtools->application->serviceworkers on https://flespi.io/toolbox Maybe we misunderstood each other?! ;)

Google Chrome 65.0.3325.162 - ok Opera Developer 55.0.2955.0 - ok Firefox 61 - ok

rstoenescu commented 6 years ago

Probably because v0.16 deals with PWAs through the new and recommended (and future of PWAs) package called Workbox, and <= 0.15 uses the old sw-precache... Like I said, gonna make one more try. Hope it works out.

rstoenescu commented 6 years ago

Ok, good news! Tested with Chrome 64 and I can confirm that the browser error is no longer reproducing, so they must have fixed it. So starting with next Quasar CLI version (releasing beta in a few days) you'll be able to deploy PWAs on subfolders.