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

HMR for NextJS failed on windi.config.js change #91

Open
donrsh opened this issue Aug 30, 2021 · 2 comments
Open

HMR for NextJS failed on windi.config.js change #91

donrsh opened this issue Aug 30, 2021 · 2 comments

Comments

@donrsh
Copy link

donrsh commented Aug 30, 2021

Describe the bug
As title. It seems windi.config.js change doesn't cause HMR on a next.js project.

To Reproduce
Steps to reproduce the behavior:

  1. Clone repository: https://github.com/donrsh/issue-NextJS-HMR-on-windi-config-change
  2. Run yarn dev
  3. Visit http://localhost:3000
  4. Modify extend color in windi.config.js (e.g. red: "#f00" -> red: "#0f0")

Expected behavior
Observe that the title that consumes text-red (pages/index.js - line15) class didn't change color. Even reload doesn't trigger the update. One needs to rerun the dev server for the change to apply.

Screenshots
The color of highlighted texts should change.
image

Additional context
I work on Windows.

@harlan-zw
Copy link
Member

Hey @donrsh

Thanks for the issue and reproduction link!

I took a quick look and unfortunately couldn't replicate the issue. Which means it's either one of two things:

  • Something weird going on with your caching, try deleting the node_modules/.cache folder
  • A windows specific issue on watching files

If it's not the first issue then it's a bit tricky for me to debug since I don't have windows. What might help is to run it in debug mode

    "dev": "set DEBUG=windicss-webpack* && next dev",

if set doesn't work, try cross-env

Can you see if you have a line like this

 windicss-webpack-plugin:plugin config dependency at /home/harlan/packages/webpack-windicss-plugin/issue-NextJS-HMR-on-windi-config-change/windi.config.js +60ms

Also can you paste the contents of the debug once you modify the file, if any

@donrsh
Copy link
Author

donrsh commented Sep 2, 2021

Hi, @harlan-zw, thanks for the help.

By following the instruction, here's the results

  1. There is a line saying the windi.config.js is used:
    擷取1

  2. No output to terminal after windi.config.js change. While modifying the page files DOES show some stuff:
    image

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