Skip to content

DX: Show clearer warning when dsn is missing or empty during initialization #18491

@Mohataseem89

Description

@Mohataseem89

Problem Statement

When initializing the Sentry JavaScript SDK with a missing or empty dsn, the SDK either fails silently or logs a very generic message. This can be confusing, especially for new users trying Sentry for the first time.

Because no events are sent, users may assume the SDK is broken, when in reality the configuration is incomplete.

Solution Brainstorm

detect an empty or missing dsn early during Sentry.init()
In development mode only, log a clear and actionable warning

Example warning:
“Sentry DSN is missing or empty. Events will not be sent.”

ensure the warning:
Runs once to avoid log noise

does not change production behavior
apply consistently across JavaScript SDKs where possible

Additional Context

Missing or empty DSN is a very common setup mistake
Silent failure increases onboarding friction
A clear warning would significantly improve developer experience
Behavior in production can remain unchanged

Priority

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions