SolidJSS
SolidJSโ€ข3y agoโ€ข
3 replies
baxuz

Use ErrorBoundary inside a createRoot?

I'm using a pattern where I have a globally accessible resource on a createRoot:

export const [solidStore, updateSolidStore] = createRoot(() => {
  const [myResource] = createResource(
    {
      licenseKey: import.meta.env.VITE_LICENCE_KEY,
    },
    resourceCreator
  );


However the resourceCreator can error out, crashing the entire application with it. Is there a way to handle this inside a createResource?
Was this page helpful?