Skip to content

Could not determine debug ID when using stdin with esbuild #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TheHolyWaffle opened this issue Feb 26, 2025 · 2 comments
Open

Could not determine debug ID when using stdin with esbuild #688

TheHolyWaffle opened this issue Feb 26, 2025 · 2 comments

Comments

@TheHolyWaffle
Copy link

TheHolyWaffle commented Feb 26, 2025

Environment

@sentry/esbuild-plugin version 3.2.1
esbuild version 0.25.0

Related to an earlier attempt to fix this by someone: #522

Steps to Reproduce

  1. Create a build.js file with the following content:
import { sentryEsbuildPlugin } from '@sentry/esbuild-plugin';
import esbuild from 'esbuild';
import { join } from 'node:path';

const result = await esbuild.build({
        stdin: {
            contents: `export const foo = 'bar';`,
        },
        outfile: join(options.outDir, `${options.outputFile}.js`),
        bundle: true,
        platform: 'node',
        target: `node${nodeVersion}`,
        external: ['@aws-sdk/*', 'dd-trace', 'datadog-lambda-js'],
        treeShaking: true,
        sourcemap: true,
        minify: true,
        plugins: [
            sentryEsbuildPlugin({
                org: 'REDACTED',
                authToken: 'REDACTED',

                project: options.sentry?.project ||,

                release: {
                    name: options.sentry?.release,
                    dist: options.sentry?.dist,
                    setCommits: { auto: true, ignoreMissing: true },
                },
                debug: true,
            }),
        ],
    });

Expected Result

It should generate sourcemaps for the provided stdin content and upload them to Sentry. Replacing the stdin option with an entryPoints: ['path/to/file.js'], does result in sourcemaps being generated and uploaded to Sentry.

Actual Result

Logs:

No sourcemaps are uploaded

[sentry-esbuild-plugin] Debug: No `sourcemaps.assets` option provided, falling back to uploading detected build artifacts.
[sentry-esbuild-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: /Users/bert.degeyter/dev/showpad-typescript/packages/cdk-nodejs-function/cdk.out/e2e-nodejs-function-bert-degeyter/esbuild-src-tests-fixtures-hello-world.ts-index/index.js
  WARN    2025-02-26 16:19:11.222587 +01:00 The --use-artifact-bundle option and the SENTRY_FORCE_ARTIFACT_BUNDLES environment variable are both deprecated, and both will be removed in the next major version.
> Found 0 files
> Adding source map references
> Nothing to upload
[sentry-esbuild-plugin] Info: Successfully uploaded source maps to Sentry
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Feb 26, 2025
@chargome
Copy link
Member

Hey @TheHolyWaffle (nice username btw), thanks for reaching out!

This is currently not supported and unfortunately I doubt this will be highly prioritised atm. Could you try to solve your use case with just Sentry CLI instead?

@TheHolyWaffle
Copy link
Author

I can workaround this by writing the content to a temporary file. And using that temporary file as the entrypoint for esbuild. It achieves the same but with the extra steps of writing to a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants