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
Prop className
did not match. Server: "sc-kEYyzF gfWKdx" Client: "sc-ifAKCX cFlEyZ"
#2147
Comments
If they're different with the babel plugin on and ssr mode enabled, your code likely has different behavior on the server vs client. In general, it's best to put client-specific enhancements in Some code smells to search for: |
I don't have those ones. Here is what I did. I have a package (A) using |
Ah is the usage in the library you’re using transpiled as well? All styled components need to be run through the babel plugin to ensure they’re consistent for SSR. Babel doesn’t transpile things in node_modules by default. |
The library I used the Then in the main site, I used |
There's a related issue for this in the nextjs repo : vercel/next.js#4068 I don't think the error comes from styled-components itself, but rather from either nextjs or some babel config. |
Environment
next: 6.1.1
babel-plugin-styled-components: 1.8.0
styled-components: 3.3.3
.babelrc
Expected Behavior
Server and Client style has to be the same
Actual Behavior
The server-side generates the right style. However, the client-side broke down the UI.
The text was updated successfully, but these errors were encountered: