Skip to content

Script tag injection makes Remix hydration fail #7959

@aymeric-giraudet

Description

@aymeric-giraudet

🐛 bug report

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project
    adheres to.
  • I have searched the issue tracker for an issue that matches the one I want
    to file, without success.

Description of the problem

I suspect the injection of a <script> with preview-protocol.js as its src causes an error with hydration on Remix applications.
It even does so on the official Remix CodeSandbox.

How has this issue affected you? What are you trying to accomplish?

When using react-dom <= 18.1.0, the hydration error makes the whole page go blank.
On react-dom = 18.2.0, it does not make it blank but still outputs the error in the console. This can be a problem as it can obscure actual hydration problems caused by the source code, and perhaps other issues I'm not aware of.

To Reproduce

  • Simply set up a CodeSandbox of an app using Remix, or use the official template
  • Open Console in Devtools
  • Errors related to hydration are logged

Link to sandbox:

Official Remix template

Remix template with react-dom downgraded, in this one it makes the page go blank

Your Environment

Software Name/Version
Сodesandbox V2
Browser Chromium 115.0.5790.170 (arm64)
Operating System ARM MacOS 13.5

CodeSandbox version :
Version: V2
Environment: production
Sandbox: 5wfvj7
Pitcher: 0.306.0
Manager: 1.23.2
Cluster: fc-eu-0

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

    Issue actions