There will be temporary vite.config.js.timestamp files that have not been cleaned up
Problem
Describe the bug When I use Ctrl+C to terminate the process of launching vite, I may leave behind the temporary file vite.config.js.timestamp.xxxxx.mjs By checking the code, I found that the problem may be caused by the loadConfigFromBundledFile method in packages/vite/src/node/config.ts, for esm. When the temporary file is written locally and the process ends, this issue will be triggered, mainly when dynamicImport is time-consuming I am considering whether it is possible to check and clean up temporary files every time the loadConfigFromBundledFile method is executed Reproduction https://stackblitz.com/edit/vitejs-vite-rmx6nh?file=index.html&terminal=dev Steps to reproduce _No response_ System Info [code block] Used Package Manager pnpm Logs _No response_ Validations - [X] Follow our Code of Conduct - [X] Read the Contributing Guidelines. - [X] Read the docs. - [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. - [X] 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. - [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server. - [X] The provided reproduction is a minimal reproducible example of the bug.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: There will be temporary vite.config.js.timestamp files that have not been cleaned up
Related to this, these files should not be generated within the project root. Their existence causes race conditions when running multiple build/lint/type-checking/etc processes simultaneously. Here's a sample error from my CI/CD output. [code block]
Trust Score
6 verifications
- 1
Related to this, these files should not be generated within the project root. Th
Related to this, these files should not be generated within the project root. Their existence causes race conditions when running multiple build/lint/type-checking/etc processes simultaneously.
- 2
Here's a sample error from my CI/CD output.
Here's a sample error from my CI/CD output.
Validation
Resolved in vitejs/vite GitHub issue #13267. Community reactions: 13 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep