Missing styles in production (CRA + Emotion 11)
See original GitHub issueCurrent behavior:
Successfully updated codebase to emotion 11 (from 9) and using the css
prop in conjunction with craco to override the webpack config and use the @emotion/babel-preset-css-prop
preset. When running locally in development, all styles are applied properly and everything looks good. When building for production however, it seems like there are styles missing throughout the app.
To reproduce:
I don’t have a repro case as this is in app, I’m hoping I’ve just missed a step or something else obvious.
Environment information:
react
version: 17.0.1@emotion/react
version: 11.1.4
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:15 (5 by maintainers)
Top Results From Across the Web
Emotion 11
Emotion 11 is a slight evolution over the Emotion 10. It focuses mainly on the developer experience, TS types improvements, switches internals to...
Read more >the `@emotion/core` package has been renamed to ... - You.com
Apparently in Emotion 11, @emotion/core was renamed to @emotion/react, but since no version was specified when installing in yarn, @emotion/styled depends ...
Read more >How To Use Emotion for Styling in React | DigitalOcean
Learn how to style components in React using the emotion CSS-in-JS library. ... @emotion/react v11.1.4, and @emotion/styled v11.0.0.
Read more >Releases - styled-components
Add missing typeof window check when checking for duplicate instances of styled-components ... Fix React Native components accepts function as style prop.
Read more >emotion css feature is not rendering the styles (React)
and no single quote at 'bold' , it is not valid css writing style ... with create-react-app using @emotion/react 11, React 18, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes. The exact thing I was suspecting is multiple instances of the
@emotion/cache
module -@emotion/css
&@emotion/react
shares that dependency. It’s hard to tell what exactly has been wrong without inspecting a repro case. If the version of that@emotion/cache
will be the same then there shouldn’t be any problem.Does #2361 fix this issue?