jp
jp
SSolidJS
Created by jp on 6/8/2024 in #support
error handling with lazy
I have a simple SSR setup similar to https://github.com/bluwy/create-vite-extra/tree/master/template-ssr-solid. When lazy loading a route's component that has an error such as Invalid JSX: <div> cannot be child of <p>, the dev server crashes due to an unhandled exception, whereas I would expect the ErrorBoundary to catch it or at least be able to catch it when awaiting renderToStringAsync. Checking the source for lazy, I don't see a catch block when evaluating the promise: https://github.com/solidjs/solid/blob/main/packages/solid/src/server/rendering.ts#L470, so it seems the assumption is that lazy loading failures are considered fatal. Perhaps there is another way I'm missing to handle this error?
10 replies