You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says, service-worker will not load correctly if you specify a subdirectory in config.paths.base.
The sample confirms that it works correctly if config.paths.base is not set.
For example, if config.paths.base is set to /subdir, the service-worker will fail to start.
Looking at the devtools in the browser, it appears that loading https://example.com/@fs/srv/app/src/service-worker.ts is causing a 404 error.
The sample repository is as follows https://github.com/sinbino/issue-sveltekit-paths-base-serviceworker
I just added a small service-worker to the skeleton code created by npm create sveltekit.
However, since service-worker requires https to work, you may have to go through a reverse proxy that supports SSL to see it work.
When executed, the following error is printed to the console, confirming that the service worker is not running.
Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('https://example.com/subdir/') with script ('https://example.com/subdir/service-worker.js'): ServiceWorker cannot be started
Describe the bug
As the title says, service-worker will not load correctly if you specify a subdirectory in config.paths.base.
The sample confirms that it works correctly if config.paths.base is not set.
For example, if config.paths.base is set to /subdir, the service-worker will fail to start.
Looking at the devtools in the browser, it appears that loading https://example.com/@fs/srv/app/src/service-worker.ts is causing a 404 error.
If I open https://example.com/subdir/@fs/srv/app/src/service-worker.ts directly in my browser, the source can be read, so I think config.paths.base is not reflected in this section.
Reproduction
The sample repository is as follows
https://github.com/sinbino/issue-sveltekit-paths-base-serviceworker
I just added a small service-worker to the skeleton code created by npm create sveltekit.
However, since service-worker requires https to work, you may have to go through a reverse proxy that supports SSL to see it work.
When executed, the following error is printed to the console, confirming that the service worker is not running.
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: