-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
There will be temporary vite.config.js.timestamp files that have not been cleaned up #13267
Comments
Start a new pull request in StackBlitz Codeflow. |
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.
|
Having the same issue using this Chrome Extension vite template |
Organizing the issues with the approach with using
|
…outlined in vitejs/vite#13267 It would occassionally cause the Svelte server to restart in an infinite loop as the temporary file created would trigger Meteor to do a restart, which in turn would create a new temporary file.
Same here. Is there a way to set location of it somewhere in |
this is need could these files be created in |
Same problem here: we have a plugin that is loaded in vite to inject git hash in the build, So it fails because the git directory non clean at that time. Workaround was to add an exclusion in gitignore. |
i didnt get the solution,same issue at my production level |
I solved this issue. vite.config.ts.timestamp-* generates in node 16 version, node 20 version.
In my package.json,_ "scripts": { "build": "tsc && rm -rf dist/vite.config.ts.timestamp-* && vite build", } Note that : Same way I tried in node 16, 20 version, it didnt worked, but finally worked for node 18 version which stops generating timestamp and deployed to production in my pm2. |
These temporary files also cause
|
also having this issue on node v21, i'm running |
I think a related issue I'm having to this one.. For me vite.config.mts is building in a loop, or vite.config.ts does if I specify type: module in package.json So going to go back to seeing the deprecated warnings since it doesn't do this with vite.config.ts |
Having this issue when I try to run a Vite+Svelte project with PM2 |
This (or something similar) happens regularly when eg. the Vite dev server is running while doing a This might be a separate bug though, because this happens due to |
One of our projects is currently struggling with annoying errors caused by these tmp files interfering with Nx and this suggested fix would resolve them, but I am also not knowledgeable enough to judge potential reprecussions. |
I'm getting a similar issue to @OndraSlejtr
|
Workaround that fixed our problem, at least from what we have observed so far, was simple adding wildcard for these tmp files into every ignore possible (.nxignore, .eslintignore, tsconfig and any other tools that might have a problem with these files). |
Unfortunately, as has been mentioned, this does nothing to help in certain environments where the directory isn't writeable. I have containerised my app using docker and the project folder where these files is written is a read-only bind-mount, and even if it wasn't read-only, root permissions would still be required. If I have to allow writes to the host filesystem I start to question the benefit of containerisation in the first place. |
@patak-dev This seems fixed by #13269 but it's still ocurr on the latest version, are you able to fix it correctly? :) |
Can we just change the pattern to use dot files? Instead of: This will solve the vast majority of issues. |
I think it's good idea to avoid creating those files at all. Because ignoring that files isn't solution. Orrr put it inside |
Did you ever find a fix for this? This all of a sudden started breaking my fly.io docker deploys and I can not figure out how to fix this. Tried adding a clean step in there but doesn't seem to work |
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> When Vite's tries to handle a `.ts` config file it builds it to JS with a `.timestamp-` suffix. These files are still picked up by Nx when they shouldn't as it's a temp file (vitejs/vite#13267). ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Add these temp files to gitignore to prevent processing. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #28371
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> When Vite's tries to handle a `.ts` config file it builds it to JS with a `.timestamp-` suffix. These files are still picked up by Nx when they shouldn't as it's a temp file (vitejs/vite#13267). ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Add these temp files to gitignore to prevent processing. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #28371
I'm pretty sure this is caused by |
At least in nx repos I see this happening nearly every time I do file changes while running a dev server. This will also spawn a CMD window which makes WebStorm loose focus. Most annoying bug ever... |
👏 legendary |
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
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: