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 HMR bug when serving only HTML #7836

Closed
7 tasks done
leonsilicon opened this issue Apr 20, 2022 · 2 comments · Fixed by #7869
Closed
7 tasks done

Vite HMR bug when serving only HTML #7836

leonsilicon opened this issue Apr 20, 2022 · 2 comments · Fixed by #7869
Labels
feat: hmr p2-edge-case Bug, but has workaround or limited in scope (priority) regression The issue only appears after a new release

Comments

@leonsilicon
Copy link

Describe the bug

When using Vite with only an HTML file, changing the code creates an HMR request but this doesn't update the HTML.

This worked in vite@2.9.0-beta.0 but stopped working in vite@2.9.0-beta.1

Here's a repro showing the regression: https://github.com/leonzalion/vite-hmr-bug

And a video:

bug.mp4

Reproduction

https://stackblitz.com/edit/vitejs-vite-vmzqtg?file=index.html&terminal=dev

System Info

System:
    OS: macOS 11.6.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 37.89 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.8.0 - ~/Library/pnpm/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.5.5 - ~/Library/pnpm/npm
  Browsers:
    Brave Browser: 100.1.37.114
    Chrome: 100.0.4896.127
    Firefox: 99.0
    Safari: 15.3

Used Package Manager

pnpm

Logs

No response

Validations

@sapphi-red sapphi-red added feat: hmr p2-edge-case Bug, but has workaround or limited in scope (priority) regression The issue only appears after a new release and removed pending triage regression The issue only appears after a new release labels Apr 21, 2022
@sapphi-red
Copy link
Member

#7262 is affecting this.

@sapphi-red
Copy link
Member

For a workaround, split css into a different file.

<style>@import './foo.css'</style>
body { background-color: yellow; }

@sapphi-red sapphi-red added the bug label Apr 21, 2022
@sapphi-red sapphi-red added the regression The issue only appears after a new release label Apr 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: hmr p2-edge-case Bug, but has workaround or limited in scope (priority) regression The issue only appears after a new release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants