Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

styled-components Hydration failed with react-compiler #75359

Closed
egorBezmen opened this issue Jan 27, 2025 · 1 comment
Closed

styled-components Hydration failed with react-compiler #75359

egorBezmen opened this issue Jan 27, 2025 · 1 comment
Labels
React Related to React.

Comments

@egorBezmen
Copy link

Link to the code that reproduces this issue

https://github.com/egorBezmen/next15-styled-components

To Reproduce

  1. npm install
  2. npm run dev

Current vs. Expected behavior

the error occurs during local development if you enable react-compiler

Unhandled Runtime Error
Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used

Image

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.2.0: Fri Dec  6 19:01:59 PST 2024; root:xnu-11215.61.5~2/RELEASE_ARM64_T6000
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 20.12.0
  npm: 10.5.0
  Yarn: N/A
  pnpm: 9.15.3
Relevant Packages:
  next: 15.2.0-canary.27 // Latest available version is detected (15.2.0-canary.27).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.7.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Runtime

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

https://github.com/vercel/next.js/tree/canary/examples/with-styled-components
I deployed the template project and enabled the option react-compiler
codesandbox - https://codesandbox.io/p/github/egorBezmen/next15-styled-components/main?import=true

@github-actions github-actions bot added the Runtime Related to Node.js or Edge Runtime with Next.js. label Jan 27, 2025
@uvansh
Copy link

uvansh commented Jan 27, 2025

I resolved the issue it was occurring due to missing next.config.js file which is need by the CSS-In-JS

@samcx samcx added React Related to React. and removed Runtime Related to Node.js or Edge Runtime with Next.js. labels Jan 28, 2025
@vercel vercel locked and limited conversation to collaborators Jan 28, 2025
@samcx samcx converted this issue into discussion #75410 Jan 28, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
React Related to React.
Projects
None yet
Development

No branches or pull requests

3 participants