Private Source Maps with Monti APM


Support for private source maps was added this week to Monti APM. Since this was custom built for Meteor apps, the set up is much simpler.

  1. Add/update the agent
  2. Replace the default js minifier with one that creates production source maps
  3. Make the source maps private
meteor add montiapm:agent
meteor remove standard-minifier-js
meteor add zodern:standard-minifier-js
meteor add zodern:hide-production-sourcemaps

There are no versions to configure or scripts to write.

The source maps are uploaded as needed for new errors, and cached by Monti APM for up to two weeks. The feature is enabled by default in production when using a minifier that creates source maps.

More information is available in the docs.

Version 3 of zodern:standard-minifier-js is also available. The main change is that now Meteor decides the file names. This removes any potential caching problems caused by always using app.js.


Well done @zodern :clap: We’ll be trying that out today :slight_smile:


Wow looking forward to try this out!


This feature was something we were missing from meteor core for a long-time. Thanks for working this out!



Trying this out now (after many, many hours spent over many weeks trying to get Sentry working with Meteor - don’t judge me!) -


Just looking through some client errors in our app from over the weekend. Full sourcemaps make it so much easier :sunglasses: :tada:


Hmm, I must be doing something wrong (tried this out and added it yesterday as a test) - here is a screenshot of a client-side error I am getting:


I wonder whether that is a mis-step on my end or whether sourcemaps don’t cover the entire code base


Thanks for trying it @hemalr87.

The last frame (XMLHttpRequest.d) was in a script loaded from a CDN, which Monti APM currently does not check for source maps (I am planning to add this).

The rest of the stack trace looks correct. It shows the package and original file names. For comparison, here is a stack trace before and after applying source maps:

    at e.<anonymous> (
    at Object.e._runFlush (
    at e (
    at render (meteor://💻app/client/components/0common/react/component.js:13:10)
    at func (meteor://💻app/packages/tracker.js:548:10)
    at index (meteor://💻app/packages/meteor.js:448:16)

INVALID_STATE_ERR is included in the filterCommonMeteorErrors error filter, which Kadira’s docs had said filtered out errors that can not be prevented.

Please let me know if you have any further questions.