Enabling `experimental.reactCompiler` causes hydration error when using styled-jsx
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/marmalade-labs/react-compiler-styled-jsx
To Reproduce
- Start the dev server
bun dev - Load the page http://localhost:3000/
- Notice the hydration mismatch error printed in the Console
Current vs. Expected behavior
Current behavior
The styled-jsx ID is successfully rendered on the server, but it is not being rendered on the client
Expected behavior
The styled-jsx ID should be present in both the server and client output
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Fri, 17 May 2024 16:56:38 +0000
Available memory (MB): 31884
Available CPU cores: 8
Binaries:
Node: 18.20.2
npm: 10.8.0
Yarn: 1.22.22
pnpm: 8.15.5
Relevant Packages:
next: 14.3.0-canary.72 // Latest available version is detected (14.3.0-canary.72).
eslint-config-next: 14.3.0-canary.72
react: 19.0.0-rc-d3ce0d3ea9-20240520
react-dom: 19.0.0-rc-d3ce0d3ea9-20240520
typescript: 5.4.5
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed)
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the linked reproduction and run bun dev, then inspect how enabling experimental.reactCompiler affects the server and client styled-jsx output. Compare the rendered styled-jsx IDs and hydration console error; done means the ID is present in both outputs and the hydration mismatch no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs, react
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100