Skip to content

[nextjs] Improve error message when CLI env vars are missing #6123

@lobsterkatie

Description

@lobsterkatie

If someone doesn't set the right environment variables in prod (specifically their sentry-cli auth token), they get an error message (Sentry reported an error: Authentication credentials were not provided. (http status: 401))which isn't wrong but also isn't as helpful as it could be. Because of the way the nextjs wizard sets things up (a locally-created but then git-ignored .sentryclirc file), it's easy for people to run into this. (The Vercel integration solves it, but not everyone deploys on Vercel.) See here for someone running into this exact problem.

Though the error comes from sentry-cli, we should be able to catch it, either in the webpack plugin or the nextjs SDK, and point people to a solution rather than just stating the problem.

(We might also think about trying to cut this problem off at the pass by telling people in the wizard that though we've set it up for them locally, they'll have to set their auth token in any other environment for things to work.)

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions