Skip to content

fix(cli): Warn that hard-coded SDKs miss the free-port fallback - #2398

Merged
MathurAditya724 merged 2 commits into
mainfrom
fix/local-free-port-notice
Nov 19, 2026
Merged

MathurAditya724 merged 2 commits into
mainfrom
fix/local-free-port-notice

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2370. When the Local daemon holds port 8969, a plain local run captures on a free port. The daemon quietly drops anything that isn't session traffic, so an SDK that hard-codes 8969 (common in browser setups) lost every event with no hint why.

The notice now gives the port it picked and says to read SENTRY_SPOTLIGHT. --verify already had a warning like this, so both now come from one small helper and can't drift apart.

Before:

$ sentry local run -- npm run dev
[info] The Local daemon is using port 8969, so this run captures on a free port. Add --session <name> to capture into the daemon instead.

$ sentry local run --verify -- npm run dev
[info] Port 8969 is in use; verifying on a free port

After:

$ sentry local run -- npm run dev
[info] Port 8969 is held by the Local daemon, so this run listens on port 40017 instead. SDKs that hard-code 8969 won't reach it; make sure they read SENTRY_SPOTLIGHT. Add --session <name> to capture into the daemon instead.

$ sentry local run --verify -- npm run dev
[info] Port 8969 is in use, so this run listens on port 43321 instead. SDKs that hard-code 8969 won't reach it; make sure they read SENTRY_SPOTLIGHT.

via @MathurAditya724.

--

View Session [Sentry]

When the Local daemon holds port 8969, a plain `local run` captures on a
free port. The daemon drops traffic that isn't for a session, so an SDK
that hard-codes 8969 lost everything with no hint. The notice now names
the port in use and says to read SENTRY_SPOTLIGHT, the same way the
--verify fallback does. Both notices come from one helper so their
wording can't drift.

Co-Authored-By: Aditya Mathur <[email protected]>
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 18, 2026 10:26pm UTC
sentry-local Ready Ready Preview Nov 18, 2026 10:26pm UTC

Request Review

@sentry-junior
sentry-junior Bot marked this pull request as ready for review November 18, 2026 20:11
@github-actions github-actions Bot added the risk: low PR risk score: low label Nov 18, 2026
…otice

# Conflicts:
#	packages/cli/test/commands/local/run.test.ts

@MathurAditya724 MathurAditya724 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the implementation, neighboring patterns, regression coverage, and review threads on this exact head. Local validation: 41 run/verify tests with real loopback listeners and child processes, including fallback-port notices and explicit-port precedence. No actionable findings remain; hosted checks are green.

@MathurAditya724
MathurAditya724 merged commit d82acde into main Nov 19, 2026
31 checks passed
@MathurAditya724
MathurAditya724 deleted the fix/local-free-port-notice branch November 19, 2026 06:46

This branch was successfully deployed

2 active deployments
Preview – cli — dabccc7f Deployed Nov 18, 2026 by vercel[bot]
Preview – sentry-local — dabccc7f Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant