Skip to main content

Why do my source maps stop working when I run my app with PM2?

Updated over a month ago

Issue

I would like to use PM2, but it breaks my source maps.

Applies To

  • Sentry Node SDK users

  • PM2 users

Symptoms

  • Source maps only work when running the app with node

  • Events are lacking Debug Ids

  • Events show proper line numbers but shows no source code

Resolution

PM2 uses a package called source-map-support. This package resolves source maps locally before they leave the client. This causes your events to leave the SDK already unminified, leaving Sentry nothing to do serverside, as the events have already been source mapped.

You will need to disable source-map-support within PM2 if you would like Sentry to resolve source maps for your app.

You can disable source-map-support with this option -

disable_source_map_support: true,

Or via their CLI with -

--disable-source-map-support
Did this answer your question?