Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nextjs): Don't crash build when auth token is missing #7427

Merged

Conversation

lforst
Copy link
Member

@lforst lforst commented Mar 13, 2023

Prevents Next.js builds from crashing during source maps upload when building and instead prints an error message that gives instructions on how to configure the auth token.

Because the webpack config is invoked 3 times, the message will show up 3 times. I will leave this up for a future fix.

@lforst lforst requested review from HazAT and AbhiPrasad March 13, 2023 09:03
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.24 KB (+0.11% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 62.95 KB (+0.11% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.87 KB (+0.1% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 55.87 KB (+0.12% 🔺)
@sentry/browser - Webpack (gzipped + minified) 20.62 KB (+0.12% 🔺)
@sentry/browser - Webpack (minified) 67.39 KB (+0.1% 🔺)
@sentry/react - Webpack (gzipped + minified) 20.65 KB (+0.12% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 48.54 KB (+0.18% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.51 KB (+0.22% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.76 KB (+0.21% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 43.17 KB (0%)
@sentry/replay - Webpack (gzipped + minified) 37.19 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 61.18 KB (+0.09% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 54.35 KB (+0.04% 🔺)

)} environment variable during the build.\n`
}${
process.env.VERCEL
? "If you're deploying to Vercel, use the Vercel integration: https://vercel.com/integrations/sentry\n"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
? "If you're deploying to Vercel, use the Vercel integration: https://vercel.com/integrations/sentry\n"
? "If you're deploying to Vercel, use the Vercel integration to automatically set a Sentry auth token: https://vercel.com/integrations/sentry\n"

Should we even show the above lines if we are on Vercel? It should be enough to just say, hey set the Vercel integration, thats all you need to do.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good suggestion: c86e63c Thanks!

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

Nice!

@lforst lforst force-pushed the lforst-dont-crash-on-missing-auth-token-and-print-log-msg branch from 55eef6f to c86e63c Compare March 13, 2023 09:48
@lforst lforst merged commit 6ae68ca into develop Mar 13, 2023
@lforst lforst deleted the lforst-dont-crash-on-missing-auth-token-and-print-log-msg branch March 13, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants