Skip to content

bug: Sentry debug ID injection causes OOM during module loading #2920

@isshaddad

Description

@isshaddad

Provide environment information

n/a

Describe the bug

Sentry's debug ID injection (sentry-cli sourcemaps inject) adds new Error().stack calls to every bundled .mjs file.

Trigger.dev's source-map-support library parses sourcemaps on every .stack access. This causes all sourcemaps to be parsed during module loading, leading to OOM before any task code runs.

Affects large projects (e.g., ~2000+ bundled files) on smaller machines like small-1x.

Reproduction repo

n/a

To reproduce

  1. Deploy a project with many bundled files to Trigger.dev
  2. Enable Sentry debug ID injection: sentry-cli sourcemaps inject --ext mjs
  3. Use small-1x machine (0.5GB RAM)
  4. Trigger any task
  5. Task fails with OOM before execution

Workaround: Skip sourcemaps inject step, rely on release-based sourcemap matching.

Additional information

Potential fixes:

  • Lazy sourcemap parsing (only on actual errors)
  • Config option to disable source-map-support
  • Document limitation for Sentry users

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions