Live reload doesn't work with Tailwind
See original GitHub issueDescribe the bug
After installing Tailwind, it stopped live reloading for changes on index.html
.
It’s weird because it logs this counter below and it does reload for main.js
.
[vite] (x2)
I’m assuming it’s still detecting changes but they are not being sent to the client.
Thanks.
Reproduction
https://stackblitz.com/edit/vitejs-vite-bbqmud?file=index.html&terminal=dev
System Info
System:
OS: Linux 5.10 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (12) x64 AMD Ryzen 5 1600 Six-Core Processor
Memory: 11.39 GB / 12.44 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 17.6.0 - ~/.asdf/installs/nodejs/17.6.0/bin/node
npm: 8.5.1 - ~/.asdf/plugins/nodejs/shims/npm
npmPackages:
vite: ^2.9.2 => 2.9.5
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Hot reload not working properly for Tailwind on WSL2
Just started a new personal project with Remix & TailwindCSS. Everything works fine with raw Remix install, but the css hot reload is...
Read more >Wiring up real-time/live browser code reloads with Tailwind
I'm trying to get my app/environment wired up to achieve the following: App with Tailwind CSS Hot reloading in the browser for UI...
Read more >Adam Wathan on Twitter: "@jeffscottward @tailwindcss ...
The hot-reloading isn't a Tailwind problem, it's a Next problem. I literally spent 5 minutes to do it for you this morning. It...
Read more >Spring live reload and webpack out of sync
I've been working on a new Spring Boot MVC project which uses Freemarker, Tailwind CSS, and Alpine.js + some custom JavaScript for the...
Read more >Difference between Hot Reloading and Live ... - GeeksforGeeks
What is Hot Reloading ? · If you are into deep navigation, hot reloading will not work properly. In this case, you have...
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
Done https://github.com/vitejs/vite/pull/7895.
I was very close to submitting another issue related to #6695, begging for the option to allow disabling forced reloads without disabling HMR altogether, since the Tailwind config was causing those in my “legacy PHP application”. The workaround in that thread doesn’t work anymore, and the thread where discussion was supposed to continue is dead.
Luckily for me, It doesn’t do that anymore after updating to 2.9.6! Was running 2.9.0 previously.
Posting this comment in case anyone else is having the same issue and thinks they need the option, that you maintainers been opposed about adding since it would have a chance of being a footgun. That thread comes up on Google while troubleshooting, so I think it’s beneficial that it contains a link to this thread. After all, finding this issue made me realise updating might fix my issue. I probably wouldn’t have updated Vite otherwise, due to the traumas Webpack upgrades gave me.
Thanks for the great work!