Skip to content

esbuild plugin fails to create a release #263

@happenslol

Description

@happenslol

Environment

node v19.9.0
npm v9.6.3
esbuild v0.17.19
@sentry/esbuild-plugin v2.0.0

Steps to Reproduce

I've created a minimal reproduction here.

Expected Result

A new release should be created and uploaded to sentry. The build should complete without issues.

Actual Result

The build fails to resolve _sentry-debug-id-injection-file as well as _sentry-release-injection-file. From what I can see in the source here, these should be added as virtual files that are retrieved using the js loader, but somehow they are not picked up.

Here's the full build log:

> node scripts/bundle.js

[sentry-esbuild-plugin] Info: Sending error and performance telemetry data to Sentry. To disable telemetry, set `options.telemetry` to `false`.
✘ [ERROR] Could not resolve "_sentry-debug-id-injection-file"

✘ [ERROR] Could not resolve "_sentry-release-injection-file"

2 errors
> Found 0 files
> Adding source map references
> Nothing to upload
/tmp/sentry-test/node_modules/esbuild/lib/main.js:1636
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 2 errors:
error: Could not resolve "_sentry-debug-id-injection-file"
error: Could not resolve "_sentry-release-injection-file"
    at failureErrorWithLog (/tmp/sentry-test/node_modules/esbuild/lib/main.js:1636:15)
    at /tmp/sentry-test/node_modules/esbuild/lib/main.js:1048:25
    at /tmp/sentry-test/node_modules/esbuild/lib/main.js:1512:9
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Could not resolve "_sentry-debug-id-injection-file"'
    },
    {
      detail: undefined,
      id: '',
      location: null,
      notes: [],
      pluginName: '',
      text: 'Could not resolve "_sentry-release-injection-file"'
    }
  ],
  warnings: []
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions