-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Routing in app built by adapter-static is broken in next.266 #3852
Comments
This regressed in What's happening is that instead of:
The following is being generated:
Which won't work in most web servers if navigating to the bare |
@jamesb93 looks like they changed the config so that https://kit.svelte.dev/docs/configuration#trailingslash @Rich-Harris not sure about changing the default (per your PR) ... at least on a website hosted using the default settings for S3 hosting, |
Thanks @fzembow, this explains why I'm seeing the issue I can see. |
I'm on I have this in (the default for new demo init project) <link rel="icon" href="%svelte.assets%/images/icons/favicon.png" /> The issues in my case are:
If I use |
Rich said he tested this against Apache. It looks like S3 and nginx behave differently though. Are there any other web hosts / servers that people are encountering this issue with? |
I'm simple using a |
But the problem is also with |
For anyone running Apache facing this issue right now and in need of a quick fix:
This of course, is a very hacky solution. And most importantly: you loose SSR. That, admittedly, is not great. But if in your case SEO is also not of the utmost importance, then this could help you for the time being. |
Please take a look at If you set that option it will generate |
For my fellow Google searchers/troubleshooters, if you are doing anything with dynamic paths:
...and you use
|
How about making the output path structure independent of the treatment of trailing slashes? A separate option could be added to determine whether |
* add picocss * fix refresh bug * use main container https://picocss.com/docs/containers.html * add calculators page, better bindings * fix routing issues in static build (nginx config, separate repository) sveltejs/kit#3852 * lang="ts", and allow importing ts ext * generate sourcemap, can also do 'inline'. see: https://vitejs.dev/config/build-options.html#build-sourcemap * add build:dev npm task * upgrade deps
Describe the bug
Since upgrading to the latest version of SvelteKit a site which is compiled with the static adapter no longer works when served via Nginx.
For example routing to https://mywebsite.com works but routing to https://mywebsite.com/hello results in 404. If I were to navigate to the second link internally via an
<a>
the 404 would not appear. I can resolve the issue by pinning the SvelteKit version to something like 250 but being on the HEAD manifests the error.Reproduction
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: