diff --git a/src/app/api/translator/console-logs/stream/route.js b/src/app/api/translator/console-logs/stream/route.js index 5eb3ae37..51ed3702 100644 --- a/src/app/api/translator/console-logs/stream/route.js +++ b/src/app/api/translator/console-logs/stream/route.js @@ -83,8 +83,9 @@ export async function GET(request) { return new Response(stream, { headers: { "Content-Type": "text/event-stream", - "Cache-Control": "no-cache", + "Cache-Control": "no-cache, no-transform", "Connection": "keep-alive", + "X-Accel-Buffering": "no", }, }); } diff --git a/src/instrumentation.js b/src/instrumentation.js new file mode 100644 index 00000000..f511eae2 --- /dev/null +++ b/src/instrumentation.js @@ -0,0 +1,6 @@ +export async function register() { + if (process.env.NEXT_RUNTIME === "nodejs") { + const { initConsoleLogCapture } = await import("@/lib/consoleLogBuffer"); + initConsoleLogCapture(); + } +}