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

CSS updates cause full page reload #18

Open
bradlc opened this issue Jul 14, 2021 · 1 comment
Open

CSS updates cause full page reload #18

bradlc opened this issue Jul 14, 2021 · 1 comment

Comments

@bradlc
Copy link
Contributor

bradlc commented Jul 14, 2021

Normally when saving a global CSS file in Nuxt the styles are updated via a "hot reload." However, when using the @nuxt/postcss8 module this does not happen and the web page is fully reloaded instead.

Reproduction

  1. Clone https://github.com/bradlc/nuxt-postcss8-bug
  2. Run npm install
  3. Run npm run dev
  4. Change the background color in assets/css/main.css
  5. Notice that the web page does a full reload instead of a hot reload

Warnings logged in the browser when updating the CSS file

Ignored an update to unaccepted module ./node_modules/@nuxt/postcss8/node_modules/css-loader/dist/cjs.js?!./node_modules/@nuxt/postcss8/node_modules/postcss-loader/dist/cjs.js?!./assets/css/main.css -> ./assets/css/main.css -> ./.nuxt/App.js -> ./.nuxt/index.js -> ./.nuxt/client.js -> 0
[HMR] The following modules couldn't be hot updated: (Full reload needed)
This is usually because the modules which have changed (and their parents) do not know how to hot reload themselves. See https://webpack.js.org/concepts/hot-module-replacement/ for more details.
[HMR]  - ./node_modules/@nuxt/postcss8/node_modules/css-loader/dist/cjs.js??ref--3-oneOf-1-1!./node_modules/@nuxt/postcss8/node_modules/postcss-loader/dist/cjs.js??ref--3-oneOf-1-2!./assets/css/main.css
[HMR] Reloading page
@fabis94
Copy link

fabis94 commented Aug 27, 2021

Any updates about this bug? AFAIK there are workarounds like migrating back to the PostCSS7 compatibility build, but it would be great to hear when a real fix will arrive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants