Summary
novaRewards/frontend's Sentry integration (@sentry/nextjs@^10.50.0) is currently completely disabled and, before that, was actively crashing the production build. Error monitoring does not exist in this application right now, and re-enabling it naively (by just re-adding withSentryConfig) will reproduce the crash.
What's currently wired vs. what v10 needs
The repo has three legacy auto-loaded config files: sentry.client.config.js, sentry.server.config.js, sentry.edge.config.js, each calling Sentry.init(...) directly at module scope. This was the pattern for Sentry SDK v7/v8. Sentry SDK v10 requires the instrumentation.ts (server/edge) + instrumentation-client.ts (client) registration pattern instead — the build itself says so:
[@sentry/nextjs] It appears you've configured a `sentry.server.config.js` file. Please ensure to put
this file's content into the `register()` function of a Next.js instrumentation file instead...
[@sentry/nextjs] Could not find a Next.js instrumentation file. This indicates an incomplete
configuration of the Sentry SDK...
[@sentry/nextjs] It seems like you don't have a global error handler set up...
[@sentry/nextjs] DEPRECATION WARNING: It is recommended renaming your `sentry.client.config.js` file...
With withSentryConfig(...) still wrapping next.config.js (as it was originally), next build's static-generation step crashed on every page:
TypeError: Cannot read properties of null (reading 'useContext')
at o (.next/server/chunks/708.js:1:2709)
at w (.next/server/chunks/939.js:1:23951)
Error occurred prerendering page "/"
i.e. Sentry's webpack instrumentation, wrapping page components under the old/incompatible config pattern, was producing broken output that crashed React during prerendering — not a flake, reproduced consistently across multiple builds.
Current state (workaround, not a fix)
To unblock the production build, withSentryConfig has been removed from next.config.js entirely (it now just exports withBundleAnalyzer(nextConfig)), and a comment was left explaining why. This means:
- No error monitoring, performance tracing, session replay, or release tracking ships to production at all.
- The
sentry.*.config.js files, NEXT_PUBLIC_SENTRY_DSN/SENTRY_ORG/SENTRY_PROJECT/SENTRY_AUTH_TOKEN env vars, and the source-map upload plugin options in next.config.js's (now-removed) sentryWebpackPluginOptions are all dead configuration.
Suggested approach
- Follow the Sentry Next.js v10 migration guide: create
instrumentation.ts at the project root with a register() function that calls Sentry.init(...) for the server/edge runtimes (port the content of sentry.server.config.js/sentry.edge.config.js in, branching on NEXT_RUNTIME), and instrumentation-client.ts for the client-side init (port sentry.client.config.js).
- Add a
global-error.tsx at the app root wired to Sentry.captureException (the build warning explicitly flags this as missing) so React rendering errors are actually reported.
- Delete the now-obsolete
sentry.server.config.js / sentry.edge.config.js / sentry.client.config.js.
- Re-add
withSentryConfig(withBundleAnalyzer(nextConfig), sentryWebpackPluginOptions) in next.config.js and confirm next build completes cleanly with it in place — this needs to be verified against a real (or dummy) NEXT_PUBLIC_SENTRY_DSN, since the crash may only have reproduced under specific env conditions (this environment had no DSN configured, which didn't prevent the crash — worth confirming whether a real DSN changes anything).
- Once building cleanly, verify an actual test event reaches Sentry (throw a test error behind a debug route) before considering this closed — a build that merely compiles with Sentry re-enabled isn't proof monitoring actually works.
Priority
High — this is a production observability gap (zero error visibility) sitting behind what currently looks, from the outside, like intentional/working Sentry configuration.
Summary
novaRewards/frontend's Sentry integration (@sentry/nextjs@^10.50.0) is currently completely disabled and, before that, was actively crashing the production build. Error monitoring does not exist in this application right now, and re-enabling it naively (by just re-addingwithSentryConfig) will reproduce the crash.What's currently wired vs. what v10 needs
The repo has three legacy auto-loaded config files:
sentry.client.config.js,sentry.server.config.js,sentry.edge.config.js, each callingSentry.init(...)directly at module scope. This was the pattern for Sentry SDK v7/v8. Sentry SDK v10 requires theinstrumentation.ts(server/edge) +instrumentation-client.ts(client) registration pattern instead — the build itself says so:With
withSentryConfig(...)still wrappingnext.config.js(as it was originally),next build's static-generation step crashed on every page:i.e. Sentry's webpack instrumentation, wrapping page components under the old/incompatible config pattern, was producing broken output that crashed React during prerendering — not a flake, reproduced consistently across multiple builds.
Current state (workaround, not a fix)
To unblock the production build,
withSentryConfighas been removed fromnext.config.jsentirely (it now just exportswithBundleAnalyzer(nextConfig)), and a comment was left explaining why. This means:sentry.*.config.jsfiles,NEXT_PUBLIC_SENTRY_DSN/SENTRY_ORG/SENTRY_PROJECT/SENTRY_AUTH_TOKENenv vars, and the source-map upload plugin options innext.config.js's (now-removed)sentryWebpackPluginOptionsare all dead configuration.Suggested approach
instrumentation.tsat the project root with aregister()function that callsSentry.init(...)for the server/edge runtimes (port the content ofsentry.server.config.js/sentry.edge.config.jsin, branching onNEXT_RUNTIME), andinstrumentation-client.tsfor the client-side init (portsentry.client.config.js).global-error.tsxat the app root wired toSentry.captureException(the build warning explicitly flags this as missing) so React rendering errors are actually reported.sentry.server.config.js/sentry.edge.config.js/sentry.client.config.js.withSentryConfig(withBundleAnalyzer(nextConfig), sentryWebpackPluginOptions)innext.config.jsand confirmnext buildcompletes cleanly with it in place — this needs to be verified against a real (or dummy)NEXT_PUBLIC_SENTRY_DSN, since the crash may only have reproduced under specific env conditions (this environment had no DSN configured, which didn't prevent the crash — worth confirming whether a real DSN changes anything).Priority
High — this is a production observability gap (zero error visibility) sitting behind what currently looks, from the outside, like intentional/working Sentry configuration.