-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
feat: htmlp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)
Description
Describe the bug
When running the dev server on a project where:
- index.html references main.js
- main.js references ./file2.js
- file2.js references ./main.js
The server seemingly has issues identifying which files have already been loaded after a hot reload resulting in duplicate files causing errors and other unexpected runtime behavior. Here's my source list after the reload in Chrome's inspect panel:
The issue goes away if all files are imported their absolute paths (e.g. '/main.js' rather than './main.js') as described here. It appears that Vite isn't using a canonical path to identify the unique set of files for the update.
Reproduction
Steps to reproduce
unpack the zip files
cd <unpacked-folder>
npm i
npm run dev
change a file, save and check the source file list in browser's inspect panel.
System Info
Vite v6.0.6, Node v20, on Chomebook w/ ARM64 Linux but also replicated issue on windows.Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
feat: htmlp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)
