Closed bondehagen closed 2 months ago
Yeah this looks like a router issue. I'm going to move it there.
Interesting.. The problem here is that unless the promises are awaited we can't catch them. They will be uncaught. Like I can't just wrap the load function in a try {} finally {}
. It won't do anything. But it also doesn't make a ton of sense to await them here. In the browser this would be inconsequential but I'm gathering the node process is exiting.
This just hit me as well. The node process is exiting on the uncaught exception. It does not require having a route load function for me:
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^
Error
at eval (/.../src/routes/path/to/file.tsx?pick=route:20:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Connecting .catch(…)
to them (like we did with promises before async/await
was invented) should probably still work.
For the end user but not something we can do with the library. I mean hmm.. I suppose the cached functions could not throw under some circumstances.
Duplicates
Latest version
Current behavior 😯
Node process exits with unhandled exception
Expected behavior 🤔
Load function should ignore errors and ErrorBoundary should get triggered.
Steps to reproduce 🕹
Steps:
http://localhost:3000/house/gryffindor
and make sure that page workshttp://localhost:3000/house/notgryffindor
and see that node process fail with unhandlet exceptionContext 🔦
It should be possible to handle errors in combination with preloading data.
Your environment 🌎