nx
nx copied to clipboard
vite.config.mts.timestamp files not being cleaned
Current Behavior
After recent upgrade to Nx 18, running a build across projects will sometimes output vite.config.mts.timestamp files named like this:
vite.config.mts.timestamp-1709230079565-76a89799c5908.mjs
It doesn't happen every time. We see one file for each project. We are also frequently, but seemingly randomly, seeing this error:
Failed to process project dependencies with "nx/js/dependencies-and-lockfile"
After that error, running the same build command again always works. We're not sure if these two items are related and I can file separate bug reports if worthwhile.
These issues are happening with a fairly standard Nx 18.0.5 setup using the react and vite generator configurations. One change we made is the rename of vite.config.ts, to vite.config.mts, to support ESM imports in the vite config.
Expected Behavior
We would expect those vite.config.mts timestamp files to not exist on the filesystem after running build tasks.
GitHub Repo
No response
Steps to Reproduce
This is the build command used in the npm script:
nx run-many --all --target=build --runner=default
Nx Report
Node : 20.11.1
OS : linux-x64
npm : 10.4.0
nx : 18.0.5
@nx/js : 18.0.5
@nx/linter : 18.0.5
@nx/eslint : 18.0.5
@nx/workspace : 18.0.5
@nx/devkit : 18.0.5
@nx/eslint-plugin : 18.0.5
@nx/playwright : 18.0.5
@nx/react : 18.0.5
@nrwl/tao : 18.0.5
@nx/vite : 18.0.5
@nx/web : 18.0.5
typescript : 5.3.3
Failure Logs
No response
Package Manager Version
No response
Operating System
- [ ] macOS
- [X] Linux
- [ ] Windows
- [ ] Other (Please specify)
Additional Information
No response
Same issue
Had the same issue. Adding vite.config.mts.timestamp-* to .gitignore solved it for us. Had a hunch this would stop the NX Daemon from caring about these files as it must surely respect git ignores, and it seems to have worked so far. ๐
@JamesHenry just to let you know, this also happens with
vitest.config.ts.timestamp-*
Also, for reproduction, it seems to happen when we git rebase.
Is this issue still reproducible on the latest version of Nx?
The vite.config.mts.timestamp files are something that vite produces during its configuration loading. It should get cleaned up right away and not cause issues. We've also made it so that the Nx Daemon ignores those changes: https://github.com/nrwl/nx/pull/21514 so I'm curious if this is still an issue.
I have not seen this issue in some time, but I'm also no longer working with Nx consistently. Still, given the information above, I would recommend closing this issue.
Apparently the issue was resolved.
Before, when we switched branches or rebased, temporary vite/vitest files were added into our repo. Now, when doing so, no xxx timestamp is added.
I re-ran the script nx run-many --all --target=build --runner=default and still didn't have those files.
This issue has been automatically marked as stale because no results of retrying on the latest version of Nx was provided within 7 days. It will be closed in 21 days if no results are provided. If the issue is still present, please reply to keep it active. If the issue was not present, please close this issue. Thanks for being a part of the Nx community! ๐
I'm still seeing this issue on 19.6.2
This issue has been automatically marked as stale because no results of retrying on the latest version of Nx was provided within 7 days. It will be closed in 21 days if no results are provided. If the issue is still present, please reply to keep it active. If the issue was not present, please close this issue. Thanks for being a part of the Nx community! ๐
This is still an issue on 19.7.2.
Fairly easy to reproduce, just run yarn nx show project {projectname} with vite.config.mjs or .js file and reload the config (I think .ts is fixed per https://github.com/nrwl/nx/pull/21514 but not sure why it was only scoped to .ts files)
Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
The "nx/js/dependencies-and-lockfile" plugin threw an error while creating dependencies:
Error: "Unable to load C:\\repos\\catalog.web-v2\\apps\\mobile\\vite.config.js.timestamp-1726077370021-231456b0b4d81.mjs: The system cannot find the file specified. (os error 2)\nUnable to load C:\\repos\\catalog.web-v2\\apps\\mobile\\vite.config.js.timestamp-1726077370022-686e0fca3d51c.mjs: The system cannot find the file specified. (os error 2)"
at buildExplicitTypeScriptDependencies (C:\repos\catalog.web-v2\node_modules\nx\src\plugins\js\project-graph\build-dependencies\explicit-project-dependencies.js:50:21)
at buildExplicitDependencies (C:\repos\catalog.web-v2\node_modules\nx\src\plugins\js\project-graph\build-dependencies\build-dependencies.js:32:120)
at Object.createDependencies (C:\repos\catalog.web-v2\node_modules\nx\src\plugins\js\index.js:81:92)
at LoadedNxPlugin.createDependencies (C:\repos\catalog.web-v2\node_modules\nx\src\project-graph\plugins\internal-api.js:60:59)
at createDependencies (C:\repos\catalog.web-v2\node_modules\nx\src\project-graph\plugins\isolation\plugin-worker.js:88:49)
at consumeMessage (C:\repos\catalog.web-v2\node_modules\nx\src\project-graph\plugins\isolation\messaging.js:38:32)
at C:\repos\catalog.web-v2\node_modules\nx\src\project-graph\plugins\isolation\plugin-worker.js:21:47
at Socket.<anonymous> (C:\repos\catalog.web-v2\node_modules\nx\src\utils\consume-messages-from-socket.js:13:17)
at Socket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
I can confirm, adding *.timestamp-* or similar to gitignore will fix this locally so nx doesn't pick it up.
This issue has been automatically marked as stale because no results of retrying on the latest version of Nx was provided within 7 days. It will be closed in 21 days if no results are provided. If the issue is still present, please reply to keep it active. If the issue was not present, please close this issue. Thanks for being a part of the Nx community! ๐
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.