Vite + Tailwind automatic full page reload
See original GitHub issueDescribe the bug
I’m not sure if this is a bug with Vite or Tailwind, but it looks similar to #4147, #4267 and #4150. The difference is that this “bug” actually works too good (which is a weird thing to say I know).
HMR works perfectly as it should, but when altering files that Tailwind lists in its purge
list in the Tailwind config, the browser reloads automatically. This shouldn’t be happening. Normally, we use the ViteRestart plugin to tell Vite it needs to watch some files that are not JS, and if they change it should reload the browser.
But as I read in the linked git issues, this is because Tailwind adds them as dependencies and Vite picks them up. This should be fixed in 2.4.3 but not the issue I have.
Reproduction
I think it is clear.
System Info
System:
OS: macOS 11.6
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 372.11 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.22.7 - /usr/local/opt/node@12/bin/node
npm: 6.14.15 - /usr/local/opt/node@12/bin/npm
Browsers:
Chrome: 96.0.4664.55
Edge: 95.0.1020.53
Firefox: 92.0.1
Firefox Developer Edition: 95.0
Safari: 15.0
npmPackages:
@vitejs/plugin-legacy: ^1.6.3 => 1.6.3
vite: ^2.6.14 => 2.6.14
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/vue-next 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 2 years ago
- Reactions:5
- Comments:6 (1 by maintainers)
Top Results From Across the Web
vite is not auto reloading index.html on save after tailwind ...
I have installed Vite with Tailwind. But after installing Tailwind , when I change the index.html file, the Vite server does not auto...
Read more >HMR API - Vite
'vite:beforeFullReload' when a full reload is about to occur; 'vite:beforePrune' when modules that are no longer needed are about to be pruned; 'vite:invalidate ......
Read more >Usage - Laravel Vite
Vite integration for the Laravel framework. ... is enabled: editing a Blade file will trigger a full-page refresh, but editing assets which Vite...
Read more >Fixing Hot Module Reload of Vite App in WSL - YouTube
Is hot reloading not working in your app created with Vite ? For Windows and WSL users polling might the solution to your...
Read more >Recommended Plugins | Vite Ruby
env in the client code is not an option. Full Reload #. Use vite-plugin-full-reload to automatically reload the page when making changes to...
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
Downgrading didn’t prevent this for me
downgrade vite to version 2.6.1 to resolve this issue.