Fix SENTRY-WIRE: install @sentry/nextjs with DSN-gated init#231
Open
bmoss2015 wants to merge 1 commit into
Open
Fix SENTRY-WIRE: install @sentry/nextjs with DSN-gated init#231bmoss2015 wants to merge 1 commit into
bmoss2015 wants to merge 1 commit into
Conversation
…erver, edge - package.json: add @sentry/nextjs ^8.55.2 - instrumentation.ts: register() loads server or edge Sentry config based on NEXT_RUNTIME; re-exports captureRequestError as onRequestError per Next 16 hook contract - sentry.client.config.ts / sentry.server.config.ts / sentry.edge.config.ts: init only when a DSN is present, so no DSN -> no-op (local dev, ad-hoc branches still build). 10% trace sampling, session replay on errors only (mask text + block media) - next.config.ts: withSentryConfig wraps the export only when SENTRY_AUTH_TOKEN / SENTRY_ORG / SENTRY_PROJECT are all set; tunnel route /monitoring to dodge ad-blockers Required Vercel env vars (Bree to add): - NEXT_PUBLIC_SENTRY_DSN (preview + production) - SENTRY_DSN (server, can equal the public one) - SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT (for source-map upload)
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@sentry/nextjsv8.55instrumentation.ts, and wrapsnext.config.tswithwithSentryConfigSENTRY_AUTH_TOKEN+SENTRY_ORG+SENTRY_PROJECTare all set/monitoringso ad-blockers don't drop error eventsRequired Vercel env vars (Bree to add)
NEXT_PUBLIC_SENTRY_DSN(preview + production)SENTRY_DSN(server scope, can be same value as the public one)SENTRY_AUTH_TOKEN,SENTRY_ORG,SENTRY_PROJECT(for source-map upload during build)Once these are set on a fresh deploy, throwing a test error from any page sends it to the Sentry project.
Test plan
/api/test-erroror throw on a page, confirm event lands in Sentryapp.nextsurplus.com/monitoringproxies to Sentry's intake