A source map is a JSON file, usually ending in .map, that records how each position in generated code corresponds to the original source file and line. Browsers load it when developer tools are open.
Why it matters
Production code is minified and bundled, so a stack trace like app.js:1:48213 is useless. With a source map, error tools and the browser show the original filename and line. Source maps can expose your unminified code if published publicly, so some teams upload them only to their error tracker.
Example
The last line of a bundle points to its map:
//# sourceMappingURL=app-3f9a1c.js.map
The map contains fields such as version, sources and mappings, the last being an encoded string of position data.
Common mistakes
- Deploying maps publicly when the source is meant to stay private.
- Forgetting to upload maps to the error-monitoring service, so reports stay unreadable.
- Assuming maps slow visitors. They load only with developer tools open.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.