Issue
Stack frames from my Next.js app under static/chunks/ stay minified in Sentry. Other frames source-map correctly. I want readable file names and line numbers for those static/chunks/ frames.
Applies To
All SaaS Customers and Self-Hosted Users
Next.js SDK
Source Maps
Error Monitoring
Resolution
Client frames under static/chunks/ stay unmapped because the Next.js SDK does not upload those files by default. Set widenClientFileUpload to true in withSentryConfig.
By default the SDK uploads client source maps from static/chunks/pages/ and static/chunks/app/. Other files under static/chunks/ are skipped. Enable widenClientFileUpload to include those extra client chunks, including maps from third-party packages.
Add
widenClientFileUpload: truetowithSentryConfigin your Next.js config file (next.config.js,next.config.mjs, ornext.config.ts):export default withSentryConfig(nextConfig, { widenClientFileUpload: true, });Run a production rebuild so the SDK can upload the wider set of source maps.
Trigger a new event. Source maps apply to events captured after the upload, not to older events.
Enabling widenClientFileUpload increases build time. See widenClientFileUpload.
If frames are still unmapped after you set widenClientFileUpload:
The SDK still skips Next.js internal chunks such as framework*, polyfills*, and webpack*. Follow Why are static/chunks frames still unmapped after widenClientFileUpload?.
