Issue
I see a "Missing Sources Context" banner at the top of my issue. My stack frames show the correct file names, line, and column numbers, but no source code. I want to know what this means and how to fix it.
Applies To
All SaaS Customers and Self-Hosted Users
Source Maps
TypeScript
Resolution
"Missing Sources Context" means your source map can locate the code (it has the mappings key for line and column numbers and the sources key for file names) but does not contain the code itself. The source code lives in the source map's sourcesContent key, which Sentry uses to display code in the UI. When sourcesContent is missing, Sentry shows the frames without source code.
To fix it, make your build include sourcesContent in the .map files:
If you compile with TypeScript, enable
inlineSources(which requires source map generation) in yourtsconfig.json:{
"compilerOptions": {
"sourceMap": true,
"inlineSources": true
}
}If you do not call TypeScript directly and bundle with webpack, set
devtooltosource-mapin yourwebpack.config.js. With this setting, webpack inlines your original source intosourcesContentby default.
After rebuilding and re-uploading your source maps, new events include the source context. To diagnose a specific event, see the source maps troubleshooting documentation.
If the context is missing only on frames outside your own code (for example, third-party or runtime frames), that is expected, because those source maps do not include sourcesContent. You can stop Sentry from using those frames for grouping by adding Stack Trace Rules in Project Settings.
