diff --git a/src/lib/functions/local-proxy.js b/src/lib/functions/local-proxy.js index 5c49548f68b..ad25b595497 100644 --- a/src/lib/functions/local-proxy.js +++ b/src/lib/functions/local-proxy.js @@ -1,3 +1,5 @@ +const { stdout } = require('process') + const { getBinaryPath: getFunctionsProxyPath } = require('@netlify/local-functions-proxy') const execa = require('../../utils/execa') @@ -34,8 +36,11 @@ const runFunctionsProxy = ({ binaryPath, context, directory, event, name, timeou '--timeout', `${timeout}s`, ] + const proxyProcess = execa(functionsProxyPath, parameters) + + proxyProcess.stderr.pipe(stdout) - return execa(functionsProxyPath, parameters) + return proxyProcess } module.exports = { runFunctionsProxy } diff --git a/tests/serving-functions-go.test.js b/tests/serving-functions-go.test.js index a87a5c8b33a..3ab462d979c 100644 --- a/tests/serving-functions-go.test.js +++ b/tests/serving-functions-go.test.js @@ -19,7 +19,7 @@ test('Updates a Go function when a file is modified', async (t) => { let proxyCallCount = 0 - module.exports = async (...args) => { + const handler = (...args) => { if (args[0] === 'go') { const binaryPath = args[1][2] @@ -45,6 +45,11 @@ test('Updates a Go function when a file is modified', async (t) => { } } } + + module.exports = (...args) => ({ + ...handler(...args) || {}, + stderr: { pipe: () => {} } + }) `) await withSiteBuilder('go-function-update', async (builder) => { diff --git a/tests/serving-functions-rust.test.js b/tests/serving-functions-rust.test.js index 7e90221d89c..900394b9b75 100644 --- a/tests/serving-functions-rust.test.js +++ b/tests/serving-functions-rust.test.js @@ -39,7 +39,7 @@ test('Updates a Rust function when a file is modified', async (t) => { const [execaMock, removeExecaMock] = await createExecaMock(` let proxyCallCount = 0 - module.exports = async (...args) => { + const handler = (...args) => { if (args[0] === 'cargo') { return { stderr: '', @@ -61,6 +61,11 @@ test('Updates a Rust function when a file is modified', async (t) => { } } } + + module.exports = (...args) => ({ + ...handler(...args) || {}, + stderr: { pipe: () => {} } + }) `) await withDevServer(