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 occurred in demo of https://github.com/reactwg/react-18/discussions/37 #4656

Open
wonsure2 opened this issue May 12, 2022 · 4 comments

Comments

@wonsure2
Copy link

Error occurred after the hydration, which leads to blank UI content. Is this demo code out of date?

https://codesandbox.io/s/kind-sammet-j56ro?file=/src/App.js

image

@gaearon
Copy link
Member

gaearon commented May 12, 2022

Hmm, I don't see this in the linked sandbox. Did you edit anything?

@wonsure2
Copy link
Author

wonsure2 commented May 13, 2022

Hi, @gaearon

It turns out that a Chrome extension(a translation tool) caused the error.

I find out that this Chrome extension will insert a <style>...</style> between </body> and </html> in the DOMContentLoaded event callback. This caused the difference between the server output HTML and the client rendering HTML.

I'm not sure whether inserting style tag between body and html closing tags is a common pattern in Chrome extension design, if so, then there might be more problems like this?

@gaearon
Copy link
Member

gaearon commented May 13, 2022

This might be getting fixed by facebook/react#24523. In that case it would still show a message but would at least be able to recover.

@gaearon
Copy link
Member

gaearon commented May 13, 2022

We also have a bigger planned section of work aimed to address this in a more resilient way. But for now this is going to cause mismatches and (after the fix in 18.2) revert to a clean client render instead of an empty page.

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

No branches or pull requests

2 participants