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

public files map isn't updated on file add/unlink in windows #15316

Closed
7 tasks done
jmlee2k opened this issue Dec 11, 2023 · 0 comments · Fixed by #15317
Closed
7 tasks done

public files map isn't updated on file add/unlink in windows #15316

jmlee2k opened this issue Dec 11, 2023 · 0 comments · Fixed by #15317

Comments

@jmlee2k
Copy link
Contributor

jmlee2k commented Dec 11, 2023

Describe the bug

In Vite 5.0.6, a map of the public files was implemented for performance (#15195).
The map is supposed to be updated when files are added or deleted, but this doesn't happen on windows.

I'll be submitting a PR to fix this shortly.

Reproduction

https://github.com/jmlee2k/vite-publicfile-bug-reproduction

Steps to reproduce

NOTE: due to the nature of the bug, this can only be reproduced in windows (hence my including of a bare-bones repo instead of using stackblitz).

  • clone repo
  • run npm i
  • run npm run dev

The index has an img tag with /vite.svg as the src. Initially, the image will be broken, as the file in /public is named vite2.svg. When renaming the file to vite.svg and reloading the page, we would expect the image to show, but it doesn't. The same thing happens if the file isn't there at all, and is moved into the public dir after starting vite.

System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 4.99 GB / 31.73 GB
  Binaries:
    Node: 18.16.0 - C:\Program Files\nodejs-lts\node.EXE
    npm: 9.5.1 - C:\Program Files\nodejs-lts\npm.CMD
    pnpm: 8.10.5 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Chrome: 120.0.6099.71
    Edge: Chromium (120.0.2210.61)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vite: ^5.0.6 => 5.0.6

Used Package Manager

npm

Logs

No response

Validations

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

Successfully merging a pull request may close this issue.

1 participant