Skip to content
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

ExtractCSS rule breaks HMR and SourceMaps in dev mode. #5390

Closed
AndrewBogdanovTSS opened this issue Mar 26, 2019 · 12 comments · Fixed by #8951
Closed

ExtractCSS rule breaks HMR and SourceMaps in dev mode. #5390

AndrewBogdanovTSS opened this issue Mar 26, 2019 · 12 comments · Fixed by #8951

Comments

@AndrewBogdanovTSS
Copy link

Version

v2.5.1

Reproduction link

https://codesandbox.io/s/w08yyp72zk

Steps to reproduce

  1. Enable extractCss in nuxt.config.js
  2. Run nuxt in dev mode
  3. Try to update css/scss inside of the component

What is expected ?

  1. Page CSS is re-rendered dynamically without a need for a page refresh
  2. Sourcemaps points to the correct file

What is actually happening?

  1. CSS changes appear only after full page refresh
  2. CSS Sourcemaps point to generated css files - not on components it was initially written
This bug report is available on Nuxt community (#c8936)
@ghost ghost added the cmty:bug-report label Mar 26, 2019
@manniL manniL added the pending label Mar 26, 2019
@manniL manniL changed the title ExtractCSS rule brakes HMR and SourceMaps in dev mode. CSS changes aren't registered ExtractCSS rule breaks HMR and SourceMaps in dev mode. Mar 29, 2019
@manniL
Copy link
Member

manniL commented Mar 29, 2019

Should be probably reported to https://github.com/faceyspacey/extract-css-chunks-webpack-plugin/ as well which is used for extractCSS

@mkurczewski
Copy link

Dirty fix:

{
  // ...
  extractCSS: process.env.NODE_ENV === 'production'
}

@manniL
Copy link
Member

manniL commented Mar 31, 2019

@AndrewBogdanovTSS As mentioned in faceyspacey/extract-css-chunks-webpack-plugin#161, does it still happen in nuxt-edge (which depends on v4.2.X)?

@levemsan
Copy link

The problem persists even with nuxt-edge and extract-css-chunks-webpack-plugin^4.2.0.

@AndrewBogdanovTSS
Copy link
Author

@manniL yes, I tried to use latest version of extract-css-chunks-webpack-plugin and only after that logged an issue in their repo

@AndrewBogdanovTSS
Copy link
Author

@manniL just tested it with latest Nuxt 2.6.0 beta which uses extract-css-chunks-webpack-plugin 4.2.0. and can confirm that it's still broken. I've also updated a repro link to use 4.2.0 explicitly

@gerbenqikker
Copy link

I also am experiencing this on Nuxt 2.6.0

@davision
Copy link

davision commented Apr 9, 2019

I can confirm this. It was super frustrating before I've realized, the extractCSS was the issue with HMR. The issue exists from v2.5.0 on.

@cannap
Copy link

cannap commented Apr 18, 2019

Hi, i have this also in Nuxt.js v2.6.2

@ashnamuh
Copy link

I have the same issue on 2.7.1

@aloiseau17
Copy link

There is any news about this issue ?
Related issue on extract-css-chunks-webpack-plugin is close but problem still occur for me.

@Venegrad
Copy link

Venegrad commented Nov 3, 2020

still have this problem with extractCSS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Bugs 🐞
  
Fixed
Development

Successfully merging a pull request may close this issue.