HMR with global style does not work
See original GitHub issueBug report
HMR with global style does not work.
https://nextjs.org/learn/basics/styling-components/global-styles-work
Describe the bug
When we apply global
keyword in <style jsx global>{
…css…}</style>
and then remove, we must have to reload the browser. It does not automatically change the CSS styles in browser. HMR is not working in this case.
Also sometimes we even need to restart dev server by npm run dev
If we remove keyword global
the style should be removed by HMR
If we add keyword global
the style should be added by HMR
To Reproduce
Steps to reproduce the behavior
- as described here https://nextjs.org/learn/basics/styling-components/setup
Expected behavior
it should automatically change styles
System information
- OS: Ubuntu 18.04
- Browser Chrome 79.0.3945.130
- Version of Next.js: 9.2.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:7 (6 by maintainers)
Top Results From Across the Web
reactjs - HMR not working with `withStyle` - Stack Overflow
If I add a style property to the div and set the color to blue there, it appears properly on screen. const styles...
Read more >Hot Module Replacement - webpack
HMR with Stylesheets ... Hot Module Replacement with CSS is actually fairly straightforward with the help of the style-loader . This loader uses...
Read more >Hot Module Replacement - SurviveJS
Hot Module Replacement (HMR) builds on top of the WDS. It enables an interface that makes it possible to swap modules live. For...
Read more >Creating a design system using Vanilla Extract CSS - Ryosuke
How does it work? You create styles using the Style API ( style(CSSObject) ) - similar to libraries like Styled Components, Emotion, JSS, ......
Read more >Globally accessible CSS and SCSS/ SASS in your Nuxt ...
To import global css, open your nuxt.config.js file and navigate to the css ... However in Nuxt that is not the case, the...
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
@aralroca try using the built-in sass support: https://nextjs.org/blog/next-9-3.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.