From 3f05645c56a6971912e2ac8f2372c845882ccccc Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 10 Jun 2025 15:24:41 +0200 Subject: [PATCH] fix(nextjs): Avoid tracing calls to symbolication server on dev --- .../devErrorSymbolicationEventProcessor.ts | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/nextjs/src/common/devErrorSymbolicationEventProcessor.ts b/packages/nextjs/src/common/devErrorSymbolicationEventProcessor.ts index aa190d88262d..9cda8013ed4a 100644 --- a/packages/nextjs/src/common/devErrorSymbolicationEventProcessor.ts +++ b/packages/nextjs/src/common/devErrorSymbolicationEventProcessor.ts @@ -192,22 +192,24 @@ async function resolveStackFrames( const controller = new AbortController(); const timer = setTimeout(() => controller.abort(), 3000); - const res = await fetch( - `${ - // eslint-disable-next-line no-restricted-globals - typeof window === 'undefined' ? 'http://localhost:3000' : '' // TODO: handle the case where users define a different port - }${basePath}/__nextjs_original-stack-frames`, - { - method: 'POST', - headers: { - 'Content-Type': 'application/json', + const res = await suppressTracing(() => + fetch( + `${ + // eslint-disable-next-line no-restricted-globals + typeof window === 'undefined' ? 'http://localhost:3000' : '' // TODO: handle the case where users define a different port + }${basePath}/__nextjs_original-stack-frames`, + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + signal: controller.signal, + body: JSON.stringify(postBody), }, - signal: controller.signal, - body: JSON.stringify(postBody), - }, - ).finally(() => { - clearTimeout(timer); - }); + ).finally(() => { + clearTimeout(timer); + }), + ); if (!res.ok || res.status === 204) { return null;