Skip to content

Handle the case where users define a different port/protocol #18135

@maslowivan

Description

@maslowivan

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

10.23.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

  1. enable sentry debug: true in instrumentation.ts
  2. run next.js app using the https://localhost:8080 (non default port and protocol)

Expected Result

no error in console

Actual Result

Sentry Logger [error]: Failed to symbolicate event with Next.js dev server TypeError: fetch failed

in the node.js logs:
Sentry Logger [log]: Flushing events...
Sentry Logger [log]: Flushing events...
Sentry Logger [log]: Flushing outcomes...
Sentry Logger [log]: No outcomes to send
Sentry Logger [log]: Flushing outcomes...
Sentry Logger [log]: No outcomes to send
Sentry Logger [error]: Failed to symbolicate event with Next.js dev server [TypeError: fetch failed] {
__reportSent: true,
[cause]: Error: connect ECONNREFUSED 127.0.0.1:3000
at (Error: connect ECONNREFUSED 127.0.0.1:3000) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 3000
}
}

Additional Context

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Source code related:

typeof window === 'undefined' ? 'http://localhost:3000' : '' // TODO: handle the case where users define a different port

it has:

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-frame?${params.toString()}`,
        {
          signal: controller.signal,
        },
      ).finally(() => {
        clearTimeout(timer);
      }),
    );

so it simply not implemented

maybe we can just provide some config option here?

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions