diff --git a/src/process/exec-spawn.ts b/src/process/exec-spawn.ts index 8b347e684c6e..3a02025a586d 100644 --- a/src/process/exec-spawn.ts +++ b/src/process/exec-spawn.ts @@ -69,14 +69,6 @@ export function spawnCommandWithInvocation< invocation: ReturnType; } { const { baseEnv, env, windowsVerbatimArguments, ...execaOptions } = options; - // Bun workaround (oven-sh/bun#36049): execa forwards its whole options object to - // child_process.spawn. Node ignores the extra `encoding` key there, but Bun's - // spawn feeds it into its stream constructor and throws ERR_UNKNOWN_ENCODING for - // execa's "buffer". Clearing it under Bun means buffered results arrive as utf8 - // strings instead of Buffers; callers already normalize via Buffer.from. Binary- - // exact output paths are unverified under Bun. Remove once the Bun issue is fixed. - const dropBufferEncodingForBun = - Boolean(process.versions.bun) && execaOptions.encoding === "buffer"; const commandEnv = resolveCommandEnv({ argv, baseEnv, env }); const invocation = resolveSafeChildProcessInvocation({ argv, @@ -86,7 +78,6 @@ export function spawnCommandWithInvocation< }); const child = execa(invocation.command, invocation.args, { ...execaOptions, - ...(dropBufferEncodingForBun ? { encoding: undefined } : {}), env: commandEnv, extendEnv: false, shell: false,