evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
38.21k stars 1.15k forks source link

stdout of spawned child closes #3927

Open lordnox opened 1 month ago

lordnox commented 1 month ago

Sadly I do not have a reproduction. In my codebase I have a vite service running esbuild to compile my code and I am getting an error after the first compilation step:

10:04:40 AM [vite] Internal server error: The service is no longer running
  Plugin: vite:esbuild

With a stacktrace of:

      at <anonymous> (…/node_modules/.pnpm/esbuild@0.21.5/node_modules/esbuild/lib/main.js:739:38)

Nothing here tells me why and what is happening. I traced the issue down and it looks like this line is called: https://github.com/evanw/esbuild/blob/d34e79e2a998c21bb71d57b92b0017ca11756912/lib/npm/node.ts#L286

Somehow the std of the spawned child process is closed, this does not clean up the internal child process.