[InitColorSchemeScript] Server-render in tests for React 19.3#48604
Open
Janpot wants to merge 1 commit into
Open
[InitColorSchemeScript] Server-render in tests for React 19.3#48604Janpot wants to merge 1 commit into
Janpot wants to merge 1 commit into
Conversation
Deploy previewhttps://deploy-preview-48604--material-ui.netlify.app/ Bundle size
Check out the code infra dashboard for more information about this PR. |
Member
|
#48595 is related, so it's React 19.3 and not Next.js 👀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
nightly-cronreact@nextjobs (test_unit-react@next,test_browser-react@next) fail onInitColorSchemeScript:This is a new dev-only error in React 19.3 (
react-dom@19.3.0-canary), emitted when a<script>is created during a fresh client mount. It does not fire during SSR or hydration (React adopts the existing node), so it never triggers in documented usage —InitColorSchemeScriptis only rendered server-side (Next.js_documentor the App Router root layout). The only thing client-mounting it is the test suite (createRenderer().render), where the script is also a non-executing no-op.The fix renders the component the way it's actually used: swap
render→ the existingrenderToStringhelper. No component/runtime changes —InitColorSchemeScriptstays hook-free with zero client runtime.Verified green under
react@next(19.3.0-canary-d5736f09) and pinned React, in both the node and chromium environments.