-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
__error.svelte renders in the wrong layout #2383
Comments
I have a guess as to what's causing this. If my guess is right, it's caused by an assumption in the Svelte-Kit code that you'll have roughly the same number of If I'm right about the cause, this isn't going to be as simple to fix as #2372 was, so you might need to use that workaround for a while. |
Notes for myself, or whoever ends up tackling this bug: my guess is that this is caused by the array structure of the
While rendering This could probably be solved by inserting nulls into the However, the existence of |
What I described in #2383 (comment) is actually how it works already (though |
Describe the bug
Errors can be rendered using the wrong layout. Instead of using
__layout.svelte
on the same level as__error.svelte
, it sometimes uses a layout of a higher level.Reproduction
I have a repo on Github with a minimal example: https://github.com/kevinrenskers/error-repro.
Start the dev server and go to http://localhost:3000/campaigns/1/characters/1:
Click on "Broken link" in the list on the left. Now an error page shows up, but the error is not shown next to the list, as I would expect:
It definitely has something to do with the
__layout.svelte
hierarchy, because as soon as you delete the one in[campaignId]
, the error shows as expected:Logs
No response
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response
The text was updated successfully, but these errors were encountered: