web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
8.04k stars 482 forks source link

[Bug]: `fork-ts-checker-webpack-plugin` intermittently and frequently breaks when building / using dev-server #6905

Open acnebs opened 1 week ago

acnebs commented 1 week ago

System Info

System: OS: macOS 14.5 CPU: (8) arm64 Apple M1 Memory: 174.95 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 18.20.2 - ~/.nvm/versions/node/v18.20.2/bin/node pnpm: 8.15.7 - ~/.nvm/versions/node/v18.20.2/bin/pnpm npmPackages: @rspack/cli: ^0.7.3 => 0.7.3 @rspack/core: ^0.7.3 => 0.7.3 @rspack/dev-server: ^0.7.3 => 0.7.3 @rspack/plugin-react-refresh: ^0.7.3 => 0.7.3 fork-ts-checker-webpack-plugin: ^9.0.2 => 9.0.2

Details

When using fork-ts-checker-webpack-plugin with rspack, I get frequent errors (about 50% of the time it seems) related to process communication. Error looks like this:

Error: write EPIPE
    at target._send (node:internal/child_process:872:20)
    at target.send (node:internal/child_process:745:19)
    at /[PATH]/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/expose-rpc.js:27:31
    at new Promise (<anonymous>)
    at sendMessage (/[PATH]/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/expose-rpc.js:19:38)
    at /[PATH]/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/expose-rpc.js:60:27
    at Generator.next (<anonymous>)
    at fulfilled (/[PATH]/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/expose-rpc.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -32,
  code: 'EPIPE',
  syscall: 'write'
}

Whether or not it works is incredibly random. I will try to start the dev server and it will fail, and then (with no code changes) I will try again and it will work. It seems to be slightly less likely to fail after repeated attempts, and most likely to fail if I haven't built in a while. Same thing happens when building with rspack.

Reproduce link

No response

Reproduce Steps

Unknown. But happens in our code-base quite frequently but randomly.

github-actions[bot] commented 1 week ago

Hello @acnebs, sorry we can't investigate the problem further without reproduction demo, please provide a repro demo by forking rspack-repro, or provide a minimal GitHub repository by yourself. Issues labeled by need reproduction will be closed if no activities in 14 days.