Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in error handling #896

Merged
merged 3 commits into from
Sep 24, 2024
Merged

Conversation

pmelab
Copy link
Contributor

@pmelab pmelab commented Sep 21, 2024

The error boundary does not render html or body tags and therefore causes and error itself.

Copy link

vercel bot commented Sep 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
waku ⬜️ Ignored (Inspect) Visit Preview Sep 21, 2024 3:11pm

Copy link

codesandbox-ci bot commented Sep 21, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Otherwise the error boundary itself will throw "In HTML, <h1> cannot be
a child of <#document>. This will cause a hydration error." which will
result in an infinite re-rendering loop.
Copy link
Owner

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

Comment on lines +554 to +560
function renderError(message: string) {
return createElement(
'html',
null,
createElement('body', null, createElement('h1', null, message)),
);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't feel like a final solution, but it looks good to me for now at least.

@dai-shi dai-shi merged commit 7e296e0 into dai-shi:main Sep 24, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants