-
-
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
Data Updates for /post/[slug]
, But Not For /post
#11745
Comments
Hi, Yes invalidation is completely broken in SvelteKit, buckle up : #11635 Unfortunately the team will read your issue and pretend it doesn't exist just like the other ones. Meanwhile, features like generating random images of gooses receive a lot of care and attention. |
Sorry this flew under the radar. I've just forwarded these issues to the team. Thank you for helping to compile a list of these issues. Personally, I'll try to have a look at these this week when I can, usually after work and other commitments. Recently, I've been giving myself a bit of a break as I've been feeling burnt out from looking at code at work then looking at more code after work so I haven't been looking at any issues in depth. |
Someone suggested on discord some workarounds for this particular error -- for example: export const load = async ({ params: {slug} }) => {
const post = posts.find((post) => post.slug === slug);
return { post: post ?? posts[0] };
}; I tried it and it does seem to work! As the author points out, it "seems like kit just doesn't see the dependency on slug without explicit reference". I will leave this ticket open though, as the original issue is still true and it seems to be symptomatic of deeper issues. Hopefully some of this will help with debugging. |
I'm not able to reproduce this issue by following the instructions. The pages load fine in both orders of navigation. Can you re-confirm if you're still seeing this issue? |
#11870 just fixed a lot of the issues with invalidation, so can you test to see if you're still having issues with 2.5.1? |
Describe the bug
If you use the same server load function for a root route and a slug route, the root route loses the ability to navigate to slug routes once navigated to.
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-wbh3iw?file=src%2Froutes%2Fpost%2F%5B%5Bslug%5D%5D%2F%2Bpage.server.js
If you click on "first post" and then "posts" in the header, it works fine.
If you click "posts" then "first post", you'll see how the content does not update when you click on "first post" this time.
The other routes work as expected.
It is noteworthy that the file structure in the example is:
But this bug persists for different variations that lead to the same routing structure. For example:
Etc.
Logs
There is no output to either the logs in the terminal on
http://localhost:5173/
or in the browser's console.System Info
Severity
annoyance
Additional Information
Discord Post
The text was updated successfully, but these errors were encountered: