-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev sw file gets created at "base/base/dev-sw.js?dev-sw" #683
Comments
try:
|
Thanks for your reply! Unfortunately:
Do you have any other ideas on how to solve the problem or why it occurs? |
Are you adding base in your html entry point? |
No, i am not |
can you provide a minimal reproduction? |
@userquin Minimal reproduction here, just |
@LWolf-roxtra should be fixed, released 0.19.5 |
Having the following settings in vite.config.ts:
Following the docs, i register the sw via this code:
In production stage, this registers the sw correctly, however in development, i get 404 error. After a lot of debugging and trying things out, i found out, that the sw file is being created at path "https://my-machine/my/app//my/app/dev-sw.js".
Knowing that, i found a workaround:
When setting the
serviceWorkerPath
constant like that, it works:const serviceWorkerPath = import.meta.env.MODE === "production" ? `${baseName}sw.js` : `${baseName}${baseName}dev-sw.js?dev-sw`;
Conclusion: if I use the baseName constant twice, the path to the sw is correct, and the sw gets installed.
I cannot find any other config parameter, where I have set the "/my/app/" base url/path, or seem to cannot find where I can set it, so it works.
Are you able to reproduce this aswell? Have I forgotten anything? Is this a bug maybe?
The text was updated successfully, but these errors were encountered: