Closed
Description
Describe the bug
This is a bit of an edge case, but if you:
- Throw an error on a given route and show an error page
- Provide a "reload" button on that error page that runs
goto($page.url.toString())
- The route passes
stuff
to its parent layout
On hitting the reload button, the page's stuff
will not be returned, though any props will be. Navigating away from and back to the page will populate stuff appropriately.
Reproduction
/page2
is configured to return the following from load
.
{
stuff: {
page2: true
},
props: {
number: 2
}
}
Repro steps:
- Click on "Page 2" to navigate to the page with the error. The route is configured to only throw an error on first load. The error page will be shown.
- Click the "Reload" button on the error page, which calls
goto($page.url.toString())
. The page will successfully render with the props passed fromload
, butpage2: true
will not be in stuff. - Click on "Home" to navigate home. Then click on "Page 2" again. This time
page2: true
will be in stuff.
Expected behavior: page2: true
is present in stuff
even after reloading an error page with goto
.
Logs
n/a
System Info
Can't run npx envinfo on StackBlitz.
@sveltejs/kit: 1.0.0-next.295
Severity
annoyance
Additional Information
I ran into this behavior on one of my SvelteKit sites. I'm rendering an __error
page with a reload button. The page uses stuff
to pass a title to the parent __layout
, but the title is undefined after a reload from the error page.