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

HTML auto reload is disabled when index.html is registered as a PostCSS dependency #3716

Closed
bradlc opened this issue Jun 8, 2021 · 10 comments · Fixed by #4127
Closed

HTML auto reload is disabled when index.html is registered as a PostCSS dependency #3716

bradlc opened this issue Jun 8, 2021 · 10 comments · Fixed by #4127
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@bradlc
Copy link

bradlc commented Jun 8, 2021

Describe the bug

If the index.html file is registered as a PostCSS dependency then the browser does not automatically reload when editing the index.html file as expected.

Reproduction

https://github.com/bradlc/vite-index-bug

System Info

Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:

System:
  OS: macOS 11.2.3
  CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 99.15 MB / 32.00 GB
  Shell: 5.8 - /bin/zsh
Binaries:
  Node: 16.0.0 - /var/folders/qw/ffpg9q8n6sgdyqlt84m2pxmr0000gn/T/fnm-shell-6539405/bin/node
  Yarn: 1.22.10 - /var/folders/qw/ffpg9q8n6sgdyqlt84m2pxmr0000gn/T/fnm-shell-6539405/bin/yarn
  npm: 7.10.0 - /var/folders/qw/ffpg9q8n6sgdyqlt84m2pxmr0000gn/T/fnm-shell-6539405/bin/npm
Browsers:
  Chrome: 91.0.4472.77
  Chrome Canary: 93.0.4536.0
  Firefox: 88.0.1
  Safari: 14.0.3
  Safari Technology Preview: 14.2
npmPackages:
  vite: ^2.3.7 => 2.3.7

Used package manager: npm

@y1d7ng
Copy link
Contributor

y1d7ng commented Jun 28, 2021

#3929 this pr can solve this.

@silvenon
Copy link
Sponsor

silvenon commented Jul 2, 2021

My understanding is that the fix was released in vite@v2.4.0-beta.1, but I'm still experiencing this problem in 2.4.0-beta.3. 🤔

@y1d7ng
Copy link
Contributor

y1d7ng commented Jul 3, 2021

My understanding is that the fix was released in vite@v2.4.0-beta.1, but I'm still experiencing this problem in 2.4.0-beta.3. 🤔

I tried the above repo by 2.4.0-beta.3, it works fine, can you help provide the way to reproduce, thanks

@silvenon
Copy link
Sponsor

silvenon commented Jul 3, 2021

I assumed that the example featured Tailwind's JIT mode, which is the situation where I'm experiencing this problem, but it doesn't. So never mind, the issue is probably more complex or might not be related at all, I assumed that it was because Tailwind probably adds the HTML file(s) as dependencies.

@patak-dev
Copy link
Member

@bradlc would you try your use cases against vite@2.4.0-beta.3 and close this issue if they are covered?

@mikerockett
Copy link

mikerockett commented Jul 3, 2021

Has anyone experienced full page reloads on 2.4 beta 3? Changing a class in a an SFC is triggering this. Running everything on latest/next, including Tailwind.

Edit: nevermind, I think this is related to my app as it also happens on 2.3.6. Will debug and open an issue if need be.

@ddahan
Copy link

ddahan commented Jul 3, 2021

Going from 2.3.8 to 2.4.0-beta.3 solved this issue for me.
I'm using Tailwind 2.2 with JIT mode enabled.

@bradlc
Copy link
Author

bradlc commented Jul 5, 2021

@bradlc would you try your use cases against vite@2.4.0-beta.3 and close this issue if they are covered?

I have updated the reproduction to something that still doesn't work in 2.4.0-beta.3. It looks like the issue is fixed when importing CSS from a JS file, but not when using <link rel="stylesheet">

@y1d7ng
Copy link
Contributor

y1d7ng commented Jul 5, 2021

@bradlc would you try your use cases against vite@2.4.0-beta.3 and close this issue if they are covered?

I have updated the reproduction to something that still doesn't work in 2.4.0-beta.3. It looks like the issue is fixed when importing CSS from a JS file, but not when using <link rel="stylesheet">

I opened a new pr to solve this issue #4127

@Shinigami92 Shinigami92 added has pr p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Jul 5, 2021
@bradlc
Copy link
Author

bradlc commented Jul 7, 2021

2.4.1 works great, thanks for the fix! ❤️

@github-actions github-actions bot locked and limited conversation to collaborators Jul 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants