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

Vite + Tailwind automatic full page reload #5808

Closed
7 tasks done
TomDeSmet opened this issue Nov 23, 2021 · 6 comments
Closed
7 tasks done

Vite + Tailwind automatic full page reload #5808

TomDeSmet opened this issue Nov 23, 2021 · 6 comments

Comments

@TomDeSmet
Copy link

TomDeSmet commented Nov 23, 2021

Describe 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

@nvthuong1996
Copy link

downgrade vite to version 2.6.1 to resolve this issue.

@gone
Copy link

gone commented Feb 11, 2022

Downgrading didn't prevent this for me

@ranihorev
Copy link

Downgrading to 2.3.8 resolved the issue for me

@gone
Copy link

gone commented Mar 12, 2022

Just tested with 2.8.6, which includes #6959 , and I'm still seeing this :(

@github-actions
Copy link

Hello @TomDeSmet. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@bluwy
Copy link
Member

bluwy commented Mar 13, 2022

Please provide a reproduction if this still happens. It's hard to find a fix to resolve the issue without a repro to test and verify against.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants