From 0ef541e535c9d301a62fe039c6904e4d82a5c824 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Tue, 8 Aug 2023 14:15:29 -0700 Subject: [PATCH] Increase the buffer size for discover project command The default value for maxBuffer is 1 MiB[1]. If the discover project command returns stdout or stderr that is greater than 1 MiB, the extension would error with "RangeError: stderr maxBuffer length exceeded". Set the default value for maxBuffer to 10 MiB for project discovery. [1] https://nodejs.org/api/child_process.html#child_processexeccommand-options-callback --- editors/code/src/util.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts index 38ce676157..0ddb292219 100644 --- a/editors/code/src/util.ts +++ b/editors/code/src/util.ts @@ -151,6 +151,7 @@ export function execute(command: string, options: ExecOptions): Promise } export function executeDiscoverProject(command: string, options: ExecOptions): Promise { + options = Object.assign({ maxBuffer: 10 * 1024 * 1024 }, options); log.info(`running command: ${command}`); return new Promise((resolve, reject) => { exec(command, options, (err, stdout, _) => {