Skip to content

esbuild plugin stops injecting debug IDs after the first rebuild of a context #26098

Closed

Description

@timfish

Which SDK are you using?

@sentry/bundler-plugins (esbuild plugin)

SDK Version

11.10.0

Framework Version

esbuild 0.28

Link to Sentry event

No response

Reproduction Example/SDK Setup

Create an esbuild.context() with the Sentry esbuild plugin and call rebuild() twice. The first build injects a debug ID into each entry point. The second build does not: the plugin clears its set of already wrapped entry points in setup, which esbuild runs once per context, so on a rebuild every entry point counts as already wrapped and the onResolve hook skips it.

Reported by @isaacs in #25648 (comment).

Steps to Reproduce

  1. const ctx = await esbuild.context({ entryPoints: ['entry.js'], bundle: true, sourcemap: true, outdir: 'dist', plugins: [sentryEsbuildPlugin({ ... })] })
  2. await ctx.rebuild() and check dist/entry.js for a sentry-dbid- marker and //# debugId= comment
  3. await ctx.rebuild() again and check the same file

Expected Result

Every rebuild, including watch mode, injects a debug ID into each entry point and uploads its source map.

Actual Result

From the second build on, the bundles carry no debug ID. The upload warns No source maps found for any of the N matched build artifacts and nothing is uploaded, although source maps were written.

Activity

  1. linear-code commented on Nov 4, 2026

    @linear-code
  2. github-actions commented on Nov 5, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #26099, which was included in the 11.11.0 release.

  3. added a commit that references this issue on Nov 6, 2026
    77f71ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions