Open finn753 opened 7 months ago
@finn753 can you please submit the reproduction in the form of a public git repository, just a description of the files makes it harder to replicate, especially if it's inconsistent.
I have the same issue. I was sure it was my fault, but after many attempts, it seems route groups breaks hydration.
For a second page shows correct +page.svelte then loads some random results.
Yes I can 100% confirm. After renaming grouped route to normal route, everything works fine. It is really difficult to replicate. Some results are totally random. I close my IDE, open it again, run vite dev and different route layout displays sqished front-page inside the sub page.
Hello, I experience the same issue, just as described by @dualjack.
Same here... Experiencing a weird issue where the wrong page loads. It's really really hard to replicate and happens randomly. I'll have portal/alerts but it will load the page of portal/profile (while the url does remain portal/alerts) Only fixes itself when I do a npm run dev. I'm really hoping this is some cache issue in DEV mode only...
I've managed to isolate it to the global
in a transition:slide|global
attribute. Perhaps @finn753 you can have a look at your usage of this? I was not able to replicate the issue in a skeleton app so the global transition must be in combination with more logic.
Just to add more to this topic, I've managed to discover that optional route params also causes this error. This bug breaks the main routing functionality.
For example, if you have this kind of directory structure:
-- routes -- -- [parentX] -- -- -- [[optionalParamY]] -- -- -- -- -- A -- -- -- -- -- B <--- when going here -- -- -- -- -- C <-- it loads this page -- -- -- -- -- D <-- or sometimes this page ( it's totally random )
Just to add more to this topic, I've managed to discover that optional route params also causes this error. This bug breaks the main routing functionality.
For example, if you have this kind of directory structure:
-- routes -- -- [parentX] -- -- -- [[optionalParamY]] -- -- -- -- -- A -- -- -- -- -- B <--- when going here -- -- -- -- -- C <-- it loads this page -- -- -- -- -- D <-- or sometimes this page ( it's totally random )
Have you experienced this in production? Sounds like a cache issue.
This is so annoying. I have a simple routing structure. If you are not logged in you go to the base route login page. There is a base route layout that adds some scripts, and I also do my head modifications in here. Once you login you go to the /dashboard which has a layout that renders headers and footers depending on screen size. It literally WONT render the dashboard content. I log in and it moves me to /dashboard flashes the correct content for a second then (staying at the correct url) displays the login page again. I gave up trying to fix this and just dumped all my second layout into the root layout and wrapped it all in checks to prevent it from rendering on the home route. This has been the first time since learning about Svelte and SvelteKit I am having this kind of issue and it is super disappointing. I wasn't even trying to do something complicated. Sad day for me for real.
@gtm-nayan I manage to reproduce my issue in a skeleton app. https://github.com/gwest7/sveltekit-issue-12026-demo
@gtm-nayan are you able to get the reported behaviour from the demo above?
@gwest7 Your repro seems like it's for a different issue, perhaps https://github.com/sveltejs/kit/issues/7405 ? I was looking for something that recreates the Unexpected slot in <Page>
warning
Describe the bug
Sometimes when using layout groups and layouts within them, the app shows the page for a short amount of time and then shows the root page (but keeping the same url). But after renaming the layout group to a normal path and then reverting it to a layout group it works again. So maybe it's an issue with caching
Reproduction
Create a sveltekit project with this example structure: . └── src/ ├── +page.svelte ├── +layout.svelte └── (auth)/ ├── +layout.svelte └── login/ ├── +layout.svelte └── +page.svelte
Fill all the layouts with example content and the slot and the pages also with some example layout
And then sometimes when trying to access a page within the layout group, it reverts to the root page. I really don't know how to replicate it, it seems to happen randomly and then you have to change the group to a normal route and back for it to work again
Logs
No response
System Info
Severity
annoyance
Additional Information
No response