From 87ff197817a1d9c29d033954eedc32c1ba93a729 Mon Sep 17 00:00:00 2001 From: Udit <25996904+uditdc@users.noreply.github.com> Date: Mon, 10 Jul 2023 16:07:55 +0530 Subject: [PATCH] Increase max_buffer during preview for large builds (#102) --- src/commands/function/invoke.ts | 6 ++++-- src/commands/sites/preview.ts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/commands/function/invoke.ts b/src/commands/function/invoke.ts index 5123c3e..b390154 100644 --- a/src/commands/function/invoke.ts +++ b/src/commands/function/invoke.ts @@ -133,7 +133,8 @@ export const run = async (options: any) => { } const result = execSync(`echo "${path}" | ${envString} ${runtimePath} ${manifestPath}`, { - cwd: path + cwd: path, + maxBuffer: (10000 * 1024) }).toString() if (!manifest.contentType || manifest.contentType === 'json' && result) { @@ -194,7 +195,8 @@ export const run = async (options: any) => { } const result = execSync(`echo "${stdinString}" | ${envString} ${runtimePath} ${manifestPath}`, { - cwd: path + cwd: path, + maxBuffer: (10000 * 1024) }).toString() console.log(result) diff --git a/src/commands/sites/preview.ts b/src/commands/sites/preview.ts index 0ee2055..c592f69 100644 --- a/src/commands/sites/preview.ts +++ b/src/commands/sites/preview.ts @@ -95,7 +95,8 @@ export const run = async (options: any) => { fastify.get("*", async (request, reply) => { const result = execSync(`echo "${decodeURIComponent(request.url.trim())}" | ${envString} ${runtimePath} ${manifestPath}`, { - cwd: path + cwd: path, + maxBuffer: (10000 * 1024) }).toString() if (!manifest.contentType || manifest.contentType === 'json' && result) {