Skip to content

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

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.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions