Home / Companies / Sentry / Blog / Post Details
Content Deep Dive

Building Sentry: Source maps and their problems

Blog post from Sentry

Post Details
Company
Date Published
Author
Armin Ronacher
Word Count
1,883
Language
English
Hacker News Points
-
Summary

Sentry's debug experience relies on source maps, which are used to map tokens in minified JavaScript files back to their original non-minified file names and line numbers. However, source maps have shortcomings that cause problems for platforms like Sentry, such as not fully equipping users with the information needed to understand and debug errors. Sentry tries to guess function names by tokenizing backward over a minified JavaScript file token by token but this approach can be flawed due to issues like local utility functions and ES6 method syntax. The current implementation of source maps poses challenges for safe fetching, processing, and providing customer-supplied source maps. To improve the ecosystem, collaboration between authors of minifiers and browser/debugger vendors is needed to evolve the source map format to better support scopes, WASM, and non-JavaScript languages.