Skip to content

Commit 50e2646

Browse files
authored
fix(nextjs): Avoid tracing calls to symbolication server on dev (#16533)
Noticed that this was missing here, we should not trace this I suppose!
1 parent 48f5253 commit 50e2646

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

packages/nextjs/src/common/devErrorSymbolicationEventProcessor.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -192,22 +192,24 @@ async function resolveStackFrames(
192192
const controller = new AbortController();
193193
const timer = setTimeout(() => controller.abort(), 3000);
194194

195-
const res = await fetch(
196-
`${
197-
// eslint-disable-next-line no-restricted-globals
198-
typeof window === 'undefined' ? 'http://localhost:3000' : '' // TODO: handle the case where users define a different port
199-
}${basePath}/__nextjs_original-stack-frames`,
200-
{
201-
method: 'POST',
202-
headers: {
203-
'Content-Type': 'application/json',
195+
const res = await suppressTracing(() =>
196+
fetch(
197+
`${
198+
// eslint-disable-next-line no-restricted-globals
199+
typeof window === 'undefined' ? 'http://localhost:3000' : '' // TODO: handle the case where users define a different port
200+
}${basePath}/__nextjs_original-stack-frames`,
201+
{
202+
method: 'POST',
203+
headers: {
204+
'Content-Type': 'application/json',
205+
},
206+
signal: controller.signal,
207+
body: JSON.stringify(postBody),
204208
},
205-
signal: controller.signal,
206-
body: JSON.stringify(postBody),
207-
},
208-
).finally(() => {
209-
clearTimeout(timer);
210-
});
209+
).finally(() => {
210+
clearTimeout(timer);
211+
}),
212+
);
211213

212214
if (!res.ok || res.status === 204) {
213215
return null;

0 commit comments

Comments
 (0)