You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vite allows plugins to insert javascript modules into index.html. If the number of scripts inserted into index.html varies between the Vite runs, Vite will incorrectly respond with "304 Not Modified" when browser requests a script that changed between the Vite runs.
This is a really good repro and investigation 👍 Seems to be caused by #15586. As suggested in the repro readme, maybe it's enough to compare the req.url as well after the moduleByEtag matches to fix this. It shouldn't affect the performance from #15586 as the url and etag should still be the same on refresh.
Describe the bug
Vite allows plugins to insert javascript modules into
index.html
. If the number of scripts inserted intoindex.html
varies between the Vite runs, Vite will incorrectly respond with "304 Not Modified" when browser requests a script that changed between the Vite runs.Reproduction
https://github.com/maxpatiiuk/vite-etag-bug/
Steps to reproduce
Clone this repository
Install
vite
Start the dev server
Open the browser console, and see "last script" printed once (EXPECTED). Important: make sure caching is NOT disabled in your browser dev tools
Stop the dev server, and start it again with the following command:
EXPECTED to see "first script" and "last script" in the console. INSTEAD, saw "last script" printed twice.
System Info
Used Package Manager
npm
Logs
Debug log from 1st run
Debug log from 2nd run
The text was updated successfully, but these errors were encountered: