-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Client-side router gives 404 on endpoints #2948
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
Comments
This is the intended behavior, and changed in #2656. You can use https://kit.svelte.dev/docs#anchor-options-rel-external to force a full page reload when the link is clicked. |
@Conduitry I see, thanks. Looks like this is the third such issue, perhaps it's worth mentioning this workaround in the Endpoints section? I see it mentioned in the header you've linked to, but as a user, that's not where I was searching for an answer, I was searching in the Endpoints section. |
There's a further wrinkle to this issue, which is: when using the static adapter (possibly when prerendering in general), unless the endpoint is explicitly called in a However, when I added I'm running into the same issue now with pagination on my blog: no matter what page I navigate to, the router only shows the first 10 blog posts, unless I refresh the page or navigate directly to Anyway, I mention all this because it seems there are some issues with prerendering and the router (possibly with prerendering detection) that still need to be fixed, and that cannot always be remedied simply by adding |
Describe the bug
Endpoints aren't recognized by the client-side router as valid routes, resulting in 404 errors when a user tries to navigate to an endpoint by clicking a link or triggering a
goto()
. Upon a fresh request to the server (bypassing the client-side router), the request succeeds, however.The use case for this is to allow setting cookies before redirecting, for example, to implement logout functionality.
Reproduction
https://github.com/illright/sveltekit-goto-endpoints-repro
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: