We’ve recently started using Sentry, and are generating sourcemaps using Grunt (
grunt-contrib-uglify). The sourcemaps work fine in practice, but Sentry and sourcemaps.io throw errors saying the maps aren’t encoded properly.
Inside Sentry, the error shown is “Source file was not ‘utf8’ encoding” for our main JS file,
app.js. However, running
file -I on our
app.min.js.map confirms that it’s
sourcemaps.io provides a bit more information, but it looks like all the errors are coming from third-party libraries we have embedded inside
app.js, like Underscore.js (example). The error comes from Underscore’s micro-templating module (
_.template), which has to handle character escaping.
We’d love to get sourcemaps working inside Sentry—the stack traces are super useful, but we still have to map minified to un-minified code manually at this point. Thanks for any help or advice!