Skip to content
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

stuff not populated when using goto to reload page on an __error page #4314

Closed
geoffrich opened this issue Mar 12, 2022 · 0 comments · Fixed by #4392
Closed

stuff not populated when using goto to reload page on an __error page #4314

geoffrich opened this issue Mar 12, 2022 · 0 comments · Fixed by #4392
Labels
bug Something isn't working help wanted PRs welcomed. The implementation details are unlikely to cause debate p3-edge-case SvelteKit cannot be used in an uncommon way
Milestone

Comments

@geoffrich
Copy link
Member

geoffrich commented Mar 12, 2022

Describe the bug

This is a bit of an edge case, but if you:

  1. Throw an error on a given route and show an error page
  2. Provide a "reload" button on that error page that runs goto($page.url.toString())
  3. 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

Stackblitz

/page2 is configured to return the following from load.

{
	stuff: {
		page2: true
	},
	props: {
		number: 2
	}
}

Repro steps:

  1. 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.
  2. Click the "Reload" button on the error page, which calls goto($page.url.toString()). The page will successfully render with the props passed from load, but page2: true will not be in stuff.
  3. 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.

@benmccann benmccann added this to the 1.0 milestone Mar 14, 2022
@benmccann benmccann added bug Something isn't working help wanted p3-edge-case SvelteKit cannot be used in an uncommon way labels Mar 16, 2022
@benmccann benmccann added help wanted PRs welcomed. The implementation details are unlikely to cause debate and removed help wanted labels Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted PRs welcomed. The implementation details are unlikely to cause debate p3-edge-case SvelteKit cannot be used in an uncommon way
Projects
None yet
2 participants