fix: stop hanging project typechecks - #11064
Conversation
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
||
| let treeKill: Result | undefined | ||
| try { | ||
| if (process.platform === 'win32' && child.pid != null) { |
There was a problem hiding this comment.
Can you explain in the comment why do we need this branching?
If the issue is with tinyexec, can we use child_process directly? Or should the fix be in tinyexec?
There was a problem hiding this comment.
I've opened a feature request for this on tinyexec to see if they're interested. Execa has just implemented a version of this (despite an issue for this being open for 6 years) - but they may accept a contribution. Node doesn't offer this natively, so it's less an "issue" I'd say and more an API that doesn't exist. Depends if you'd want to wait for something in the library here (that may / may not be accepted or not)! I've pushed a change for now to make the code a bit easier to read, let me know if you want me to draft this PR in the meantime while we wait to see if tinyexec will support this.
There was a problem hiding this comment.
FWIW execa https://github.com/sindresorhus/execa/pull/1256/changes#diff-5af77adef0297f94becc96dd37c6dcf70dc340b32b2657dd167b215db6e95e15 also does the branching due to the different process handling by each OS
acbed1e to
f599d69
Compare
Description
Closes #9494 -
vitest runhanging after successful project typechecking and leaving an orphanedtscortsgo --watchprocess.Project configs previously resolved
watchfromconfigDefaultsinstead of inheriting the root configuration. In an interactive terminal, this producedwatch: falseat the root butwatch: truein the project, causing the typechecker to start in watch mode duringvitest run.This PR:
watchvalue to project configsThe terminal-specific behavior was also verified using a forced interactive-terminal reproduction. After the fix, both root and project resolve
watch: false, Vitest exits normally, and no watched typechecker process remains.AI-assisted by Codex and reviewed using Claude Opus + a human (myself)!
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.