-
Notifications
You must be signed in to change notification settings - Fork 161
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?]: ErrorBoundary not functioning as described in the docs #374
Comments
That's interesting. Probably because it is throwing in the load function outside of the error boundary. I wonder what is best to do there. I guess load function has no consequence so we could just squash any errors thrown during them. But generally they are throwing outside of the component at the root level. It's a good question really. Let me think about that. |
Thanks for considering this. And maybe classic redirects to error pages is fine. I suppose my goal is to have some sort of fallback pattern in cases of errors. So maybe the issue is really just an education issue for myself (and others, I'm sure) on how we would do this in this kind of framework. I know I've played with the |
I'm going to move this to the router. Because this is really a router issue not a Start issue. |
It's interesting. With the latest(Start 0.6.x) this doesn't cause the dev mode to crash. But it is still difficult in that it does throw twice. The first that happens during load doesn't really do anything but it is thrown into space because we don't await the cache function and the cache function doesn't know not the throw at that point. It doesn't really break anything though. I think the immediate bug is fixed but I'm not sure I'm done here. Please confirm the latest works for you. |
@ryansolid, confirmed. I updated recently, and indeed the "end" result is working and not crashing my application. |
I was banging my head against this for a couple of hours. Glad I found this thread. Ya commenting out route load fixed the problem. |
Has this regressed further? #399 looks identical and I can reproduce this without a load function being present. |
Duplicates
Latest version
Current behavior 😯
I have created a basic reproducible version of using an
ErrorBoundary
to handle errors thrown inside of aFileRouter
load
function. An example of this is provided in the HttpStatusCode Page, where an Error boundary is used for handling an error thrown in a cached function.I have produced a similar example below with a newly scaffolded version 0.5.1 solid-start app. Navigating to this page produces an uncaught error and crashes the development server.
Expected behavior 🤔
The
ErrorBoundary
fallback
property should be displayed.Steps to reproduce 🕹
Steps:
pnpm
andbun
bun dev
or equivalentlocalhost:3000
Context 🔦
I am trying to handle errors in general. I was recently working on an authorization callback and handler and was facing issues with the dev server crashing when cached functions (or functions which they called) threw errors.
https://github.com/JacobSNGoodwin/scavenge-solid/blob/lucia-auth/src/routes/authorize/%5Bprovider%5D.tsx
Your environment 🌎
The text was updated successfully, but these errors were encountered: