Skip to content

Error occurred in demo of https://github.com/reactwg/react-18/discussions/37 #4656

@wonsure2

Description

@wonsure2

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

Activity

gaearon

gaearon commented on May 12, 2022

@gaearon
Member

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

wonsure2

wonsure2 commented on May 13, 2022

@wonsure2
Author

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

gaearon commented on May 13, 2022

@gaearon
Member

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

gaearon commented on May 13, 2022

@gaearon
Member

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @gaearon@wonsure2

        Issue actions

          Error occurred in demo of https://github.com/reactwg/react-18/discussions/37 · Issue #4656 · reactjs/react.dev