diff options
Diffstat (limited to 'packages/integrations/solid/src/server.ts')
-rw-r--r-- | packages/integrations/solid/src/server.ts | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/packages/integrations/solid/src/server.ts b/packages/integrations/solid/src/server.ts index a352dfa5a..295771265 100644 --- a/packages/integrations/solid/src/server.ts +++ b/packages/integrations/solid/src/server.ts @@ -28,12 +28,16 @@ async function check( // In general, components from other frameworks (eg, MDX, React, etc.) tend to render as "undefined", // so we take advantage of this trick to decide if this is a Solid component or not. - const { html } = await renderToStaticMarkup.call(this, Component, props, children, { - // The purpose of check() is just to validate that this is a Solid component and not - // React, etc. We should render in sync mode which should skip Suspense boundaries - // or loading resources like external API calls. - renderStrategy: 'sync' as RenderStrategy, - }); + let html: string | undefined; + try { + const result = await renderToStaticMarkup.call(this, Component, props, children, { + // The purpose of check() is just to validate that this is a Solid component and not + // React, etc. We should render in sync mode which should skip Suspense boundaries + // or loading resources like external API calls. + renderStrategy: 'sync' as RenderStrategy, + }); + html = result.html; + } catch {} return typeof html === 'string'; } |