Styled-components css not loading in prod mode.
See original GitHub issuePrerequisites
- Using yarn
- Using an up-to-date
masterbranch - Using latest version of devtools. Check the docs for how to update
- For issue in production release, add devtools output of
DEBUG_PROD=true yarn build && yarn startthere is no error at all, just every dive or component is not loading its css, or dev its working fine but on prod its not working.
Expected Behavior
should load all the css in prod build as its loading in dev env
Current Behavior
not loading any css at all in prod,
Steps to Reproduce
just use one styled-component with css in tsx file, it will not load the css. using styled-component 5.2.0
Possible Solution (Not obligatory)
Context
Your Environment
- Node version : 10.15.0
- electron-react-boilerplate version or branch : updated master branch
- Operating System and version : MacOS and windows
- Link to your project : not available
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (2 by maintainers)
Top Results From Across the Web
react styled components not working in production
I have been able to work with styled-components on webpack dev server without any problem but the styles are not getting added when...
Read more >styled-components does not inject styles in head #2254 - GitHub
S-C loads just fine, just the CSS injection isn't working. SSR works fine too (I have it enabled in dev mode as well),...
Read more >Next.js and Styled-Components: style loading issue
Have you tried using Styled-Components with your Next.js app but can't get the styles to load properly? This is because the server-side ......
Read more >FAQs - styled-components
However, there is a CSS solution to the problem in the font-display CSS rule. By setting the rule to "fallback" mode, once a...
Read more >Using Styled Components - Expo Documentation
Styled Components is a CSS-in-JS solution that enables you to create React components with a given style very easily. Using styled-components with Expo, ......
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 Free
Top 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

Yea that’s correct
This is still an issue an issue in version 3.0.2 (latest), please can you reopen it @awaisayub149. Following @codingedgar’s advice fixes css modules in production but breaks global css, the following code will enable both…
webpack.config.renderer.prod.babel.js: module.rules