-
-
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
$page.data
does not get updated correctly
#8157
Labels
bug
Something isn't working
Comments
The "has the data changed" logic here https://github.com/sveltejs/kit/blob/master/packages/kit/src/runtime/client/client.js#L446-L463 is flawed |
Rich-Harris
added a commit
that referenced
this issue
Jan 6, 2023
5 tasks
Rich-Harris
added a commit
that referenced
this issue
Jan 7, 2023
dummdidumm
added a commit
that referenced
this issue
Jan 16, 2023
fixes #8157 Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
I am still experiencing an issue with this where the data in the
Why is this happening? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
If the
data
returned fromload
inside a+page.server.js
("page-X") has the same shape as the data returned inside its corresponding+layout.server.js
, the$page.data
does not get updated when routing from "page-X" to another page that does not have its own+page.server.js
file.As a workaround I'm currently just adding a random key to the return value of
+layout.server.js
.Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-bcif9n?file=src/routes/page-2/+page.server.js
root
andpage-1
links a few timeroot
and thepage-2
linksroot
other: 5
to the return object in/routes/+page.layout.js
root
andpage-2
worksroot
andpage-1
does not update the headingLogs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: