Commit 9ea2966
fix(typescript): unique temp file names to fix run-multiple race (#5642)
Transpiled TypeScript files were written to a fixed "<source>.temp.mjs"
path next to the source. Under run-multiple, every forked worker transpiles
the same files to the same temp paths and cleans them up independently, so
one worker's cleanup deletes files the others still need to import — surfacing
as "Cannot find module *.temp.mjs".
Include process.pid plus a random suffix in the temp file name so each worker
writes (and removes) its own files. The names still end in ".temp.mjs", so
stack-trace remapping and fixErrorStack keep working.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 7cb5366 commit 9ea2966
2 files changed
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
389 | 391 | | |
390 | 392 | | |
391 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments