Improve error handling (#2539)
* feat: improve error handling * fix: run renderer
This commit is contained in:
parent
3f4d54282f
commit
d9ac85ea94
1 changed files with 5 additions and 0 deletions
|
@ -216,6 +216,11 @@ There ${plural ? 'are' : 'is'} ${renderers.length} renderer${plural ? 's' : ''}
|
|||
but ${plural ? 'none were' : 'it was not'} able to server-side render ${metadata.displayName}.
|
||||
|
||||
Did you mean to enable ${formatList(probableRendererNames.map((r) => '`' + r + '`'))}?`);
|
||||
} else if (matchingRenderers.length === 1) {
|
||||
// We already know that renderer.ssr.check() has failed
|
||||
// but this will throw a much more descriptive error!
|
||||
renderer = matchingRenderers[0];
|
||||
({ html } = await renderer.ssr.renderToStaticMarkup(Component, props, children));
|
||||
} else {
|
||||
throw new Error(`Unable to render ${metadata.displayName}!
|
||||
|
||||
|
|
Loading…
Reference in a new issue