Skip to content

Regression in 4.6.2: Entry chunk not receiving Debug ID injection #847

@cristi-lng

Description

@cristi-lng

Description

After upgrading from @sentry/vite-plugin 4.6.1 to 4.6.2, the main entry chunk no longer receives Debug ID injection, while all other chunks (lazy-loaded, vendor splits, etc.) are injected correctly.
This causes the warning:

[sentry-vite-plugin] Debug: Could not determine debug ID from bundle. This can happen if you did not clean your output folder before installing the Sentry plugin. File will not be source mapped: /path/to/dist/assets/index-XXXXX.js

Environment

  • @sentry/vite-plugin: 4.6.2 (broken), 4.6.1 (works)
  • vite: 5.4.x
  • Node: 22.x
  • OS: Linux (Docker) / macOS

Steps to Reproduce

  1. Create a Vite React project with @sentry/[email protected]
  2. Configure the plugin with debug: true
  3. Run production build
  4. Observe that all chunks except the main entry receive Debug IDs

Expected Result

All chunks, including the main entry bundle, should have the Debug ID snippet injected:

e._sentryDebugIds = e._sentryDebugIds || {}; e._sentryDebugIds[n] = "UUID"; e._sentryDebugIdIdentifier = "sentry-dbid-UUID";

Actual Result

  • ✅ All lazy-loaded chunks have Debug IDs
  • ✅ All vendor/split chunks have Debug IDs
  • ❌ Main entry chunk (index-*.js) has no Debug ID injection
    The main entry only contains the Sentry SDK code that reads Debug IDs, but not the injected assignment.

Plugin Configuration

sentryVitePlugin({ org: 'my-org', project: 'my-project', release: { name: process.env.BUILD_ID }, authToken: process.env.SENTRY_AUTH_TOKEN, telemetry: false, debug: true, sourcemaps: { filesToDeleteAfterUpload: ['./dist/**/*.map'], }, });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Waiting for: Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions