Menu

Source Maps

To improve loading time, Meteor minifies the app's code to reduce it's size. However, it can make debugging errors more difficult.

Monti APM supports client source maps. By using the source maps, Monti APM can modify the error stack traces to reference the line, column, and method name in the source file instead of the minified file.

When source maps are available Monti APM will automatically use them, with no additional setup required by you.

Private source maps requires montiapm:agent version 2.33.0 or newer. You can update by running meteor update montiapm:agent.

The default minifier package Meteor uses currently doesn't generate source maps. You can replace it with one that does by running these commands:

meteor remove standard-minifier-js
meteor add zodern:standard-minifier-js

To block public access to your source maps, you can run:

meteor add zodern:hide-production-sourcemaps

You can learn more about zodern:standard-minifier-js on it's Github page.

Disable

Since you have to opt into production source maps being generated, Monti APM uploads source maps by default in production, and disables uploading in development. To override the default, you can set the option with:

Environment Variable

export KADIRA_UPLOAD_SOURCEMAPS=false

Meteor Settings

"kadira": {
  "options": {
    "uploadSourceMaps": false
  }
}

Code

Kadira.connect('<app id>', '<app secret>', {
  uploadSourceMaps: false
});

How it works

Every 20 - 40 seconds, the Monti APM Agent sends statistics to Monti APM and receives a list of source maps that are needed by new errors. The agent uploads any of those source maps it finds to Monti APM. The source maps are cached for up to 2 weeks.

The error trace could be shown in the UI before the source maps were available.

Feedback

If you think Monti APM could have done a better job with an error, please share it with us. You can do this by clicking SHARE THIS, and pasting the link in the Support window (click Support in the upper left corner).