Uncaught errors crashing Solid Start server (dev and production)
The only pattern I can really tell is (I think, I'm pretty sure) all the errors I've seen actually crash the server have been thrown by dependencies. I've seen this mostly in API routes but also in some SSR rendered routes, I believe.
For a while the dev server would crash sometimes and I just restarted it thinking it was a quirk, but we're starting to see those crashes in production as well now, in a serverless environment (Vercel). Some of those errors were supposed to be caught by an ErrorBoundary during SSR, though I recognize I may have misconfigured something there (might have been an uncaught error during preload, which I can add a catch clause to if I need, that'd be on me). A few have occured for API routes though (I don't think I've seen it with server functions, at least not yet).
I would expect the server to log it and throw a 500 or something if there's an uncaught error during an API route call (or just log it and suppress the error, if the response has already been returned but some async code is still running or something). If this is not the case I will have to add a lot of try/catch clauses, but that really seems in scope of the framework.
I'd be grateful for any insight anyone could provide, if you've seen similar things, dealt with this in a particular way, if this is a known bug and will be fixed in a future release (I'd be happy to contribute towards that if that's the case), etc. I wish I could provide a minimal reproduction repo but I unfortunately I don't have the time at this exact moment, I may try to do that later this week. The specific errors we've had have been with the
neondatabase/serverless
and stripe
packages, though I suspect the issue is much more general. And to clarify again, my issue isn't with those errors being thrown, but that them not being caught causes the entire server to crash.
Thanks so much! Really enjoying Solid Start so far, otherwise0 Replies