Skip to content

fix(nextjs): Avoid tracing calls to symbolication server on dev #16533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions packages/nextjs/src/common/devErrorSymbolicationEventProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading