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

[Bug]: TailwindCSS HMR not work with rspack.CssExtractRspackPlugin.loader #6422

Open
childrentime opened this issue Apr 30, 2024 · 5 comments · Fixed by #6576
Open

[Bug]: TailwindCSS HMR not work with rspack.CssExtractRspackPlugin.loader #6422

childrentime opened this issue Apr 30, 2024 · 5 comments · Fixed by #6576
Assignees
Labels
A-css Area: css bug Something isn't working

Comments

@childrentime
Copy link

System Info

System:
OS: macOS 14.1
CPU: (8) arm64 Apple M3
Memory: 97.64 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
Yarn: 1.22.21 - ~/.nvm/versions/node/v18.12.1/bin/yarn
npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
pnpm: 8.15.5 - ~/.nvm/versions/node/v18.12.1/bin/pnpm
Watchman: 2024.04.15.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 124.0.6367.92
Edge: 124.0.2478.67
Safari: 17.1
npmPackages:
@rspack/cli: 0.6.3 => 0.6.3
@rspack/core: 0.6.3 => 0.6.3
@rspack/plugin-react-refresh: 0.6.3 => 0.6.3

Details

I am trying to use the extract loader instead of raw CSS to use Tailwind because I have a related migration that requires this loader. I have created a minimal reproduction, and there are no issues at startup. However, when you try to add a text-red-600 to the className, Hot Module Replacement (HMR) does not take effect. You have to use ctrl+c to restart the rspack dev server for it to take effect.

Reproduce link

https://github.com/childrentime/rspack-tailwindcss

Reproduce Steps

npm i
npm run dev

add text-red-600 in src/App.tsx

@childrentime childrentime added bug Something isn't working pending triage The issue/PR is currently untouched. labels Apr 30, 2024
@jerrykingxyz jerrykingxyz added A-css Area: css and removed pending triage The issue/PR is currently untouched. labels Apr 30, 2024
@chenjiahan
Copy link
Member

@JSerFeng can you share some progress for this issue~

@childrentime
Copy link
Author

Do you have any test cases for SSR tailwind HMR? I tried using the 0.70 test version and it seems to have some issues under SSR.

@JSerFeng
Copy link
Collaborator

Can you give use a minimal repro ?

@JSerFeng JSerFeng reopened this May 27, 2024
@childrentime
Copy link
Author

childrentime commented May 28, 2024

Well, it's really difficult to find a SSR template with webpack + tailwind. I might as well directly compare their differences in my project.

https://github.com/childrentime/pareto/tree/issue/tailwind/examples/tailwind

output.mp4

@childrentime
Copy link
Author

The strange point is that when rspack tailwind is hot updated, it seems to make the browser refresh once, instead of hot updating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-css Area: css bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants