File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
packages/nextjs/src/config Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -633,19 +633,24 @@ export function getWebpackPluginOptions(
633
633
// Hardcoded way to check for missing auth token until we have a better way of doing this.
634
634
if ( err && err . message . includes ( 'Authentication credentials were not provided.' ) ) {
635
635
const warningPrefix = `${ chalk . yellow ( 'warn' ) } -` ;
636
- // eslint-disable-next-line no-console
637
- console . warn (
638
- `${ warningPrefix } ${
639
- `${ chalk . bold ( 'No Sentry auth token configured.' ) } Source maps will not be uploaded.\n` +
636
+
637
+ let msg ;
638
+
639
+ if ( process . env . VERCEL ) {
640
+ msg = "To fix this, use Sentry's Vercel integration: https://vercel.com/integrations/sentry" ;
641
+ } else {
642
+ msg =
640
643
'You can find information on how to generate a Sentry auth token here: https://docs.sentry.io/api/auth/\n' +
641
644
`After generating a Sentry auth token, set it via the ${ chalk . bold . cyan (
642
645
'SENTRY_AUTH_TOKEN' ,
643
- ) } environment variable during the build.\n`
644
- } ${
645
- process . env . VERCEL
646
- ? "If you're deploying to Vercel, use the Vercel integration: https://vercel.com/integrations/sentry\n"
647
- : ''
648
- } `,
646
+ ) } environment variable during the build.`;
647
+ }
648
+
649
+ // eslint-disable-next-line no-console
650
+ console . warn (
651
+ `${ warningPrefix } ${ chalk . bold (
652
+ 'No Sentry auth token configured.' ,
653
+ ) } Source maps will not be uploaded.\n${ msg } \n`,
649
654
) ;
650
655
651
656
return ;
You can’t perform that action at this time.
0 commit comments