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

[BUG] Error from cached load() is passed to the createAsync result as value #385

Open
madaxen86 opened this issue Feb 28, 2024 · 2 comments

Comments

@madaxen86
Copy link
Contributor

madaxen86 commented Feb 28, 2024

Describe the bug

May be related to #374
When the function that is passed to the routes load() function throws an error or rejected promise, the error will be passed to the result primitive as a "successful" value if the page is refreshed and then clicked on a link to the current page (please check the video).

Your Example Website or App

https://github.com/madaxen86/solid-router-cache-load-bug.git
Stackblitz -> Note: Unlike in the attached video the error now is on the index route.

Steps to Reproduce the Bug or Issue

  1. Open code sandbox
  2. Navigate between test and home page -->all good. Errorboundary is rendered
  3. Go to test page
  4. refresh the window
  5. click on test navlink --> page is rendered with the data primitive containing the error string !?

Expected behavior

The error should always be picked up by the ErrorBoundary and never passed to the primitive returned by the createAsync function.

Screenshots or Videos

Bildschirmaufnahme.2024-02-28.um.19.01.36.mov

Platform

@solidjs/router: 0.12.4
@solidjs/start: 0.6.0

Additional context

No response

@madaxen86 madaxen86 changed the title Error from cached load() is passed to the createAsync result as value [BUG] Error from cached load() is passed to the createAsync result as value Mar 1, 2024
@ryansolid
Copy link
Member

Yeah this one is odd.. codesandbox is not being particularly helpful to me because they have a limit now on drafts unless I pay so I can't play with this much other than confirm the reproduction and that it isn't the same as the other issue. Beyond that this one is very specific to loading on the page... so there probably is an issue related to cache + hydration. I will try to look into this more in a bit.

@madaxen86
Copy link
Contributor Author

I added a stackblitz - here the error is on the home page because stackblitz reloads o on the home route when reloading the url.
Added a Github repo so you can dig into it. Thanks a lot and thanks for this amazing framework.
It is such a pleasure to work with SolidJs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants