-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 is not correctly set when a load function returns error
#5537
Comments
I'm trying to get around this issue by using a store; I use |
I've managed to trace a part of this to the However, during hydration on the client, because only the error page |
There are multiple parts to this:
1 and 2 are rather easy to fix, but 3 is tricky - we would need to replay the logic leading up to the error, so we need all nodes and call their load functions, also those discarded by the error. I don't know if this is a sensible solution. Should this instead be "works as designed"? UI-wise, everything that happened until then is discarded, so we could make the same argument for stuff. If we go that route, we still may have a bug here (haven't tested yet), but it may be that |
Closing as outdated due to #5748. |
Describe the bug
When
error
(orstatus !== 2xx
) is included in the returned object from a load function inside a route, while also providing astuff
object, the$page.stuff
store is empty.Reproduction
https://github.com/flavioosh/sveltekit-stuff-error-repro
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
I'm not sure if this is expected behaviour, but it seems that even if the object returned from a load function contains either
error
or a non-200status
, we should still get the stuff passed through to the layout or error pages. I'm not sure if I'm doing something wrong but this seems counter-intuitive.The text was updated successfully, but these errors were encountered: