How to Configure Sentry Source Maps for Self-Hosted Next.js Standalone Builds
Developers running self-hosted Next.js standalone deployments on platforms like Coolify lack the automatic source map uploads that Vercel's Sentry integration provides, leaving production stack traces unreadable. Without proper configuration, minified traces such as 's at chunk-a1b2c3.js:1:48213' offer no actionable debugging information. The @sentry/nextjs SDK can handle both uploading source maps to Sentry and removing them from the final build artifact, preventing exposure of minified code to the public. Proper setup requires configuring Next.js instrumentation.ts to initialise Sentry separately for Node.js and Edge runtimes, and exporting Sentry.captureRequestError to ensure request-level errors are captured. The build pipeline must be wired to upload maps during the build phase, before the container artifact is shipped to the runtime environment.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in