Skip to content
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

tsup - _sentry-debug-id-injection-stub #616

Closed
ex0ns opened this issue Oct 1, 2024 · 2 comments
Closed

tsup - _sentry-debug-id-injection-stub #616

ex0ns opened this issue Oct 1, 2024 · 2 comments

Comments

@ex0ns
Copy link

ex0ns commented Oct 1, 2024

Environment

@sentry/esbuild-plugin: 2.22.4
tsup: 8.3.0

Steps to Reproduce

  1. clone https://github.com/ex0ns/sentry-tsup (or look at the dist/ folder)
  2. pnpm install && pnpm tsup-node src/index.ts
  3. node dist/index.mjs

Expected Result

Running the application with Sentry enabled.

Actual Result

node:internal/modules/esm/resolve:842
  throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
        ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '_sentry-debug-id-injection-stub' imported from /Users/guillaume/Projects/magemetrics/experiments/tsup-sentry/my-app/dist/index.mjs
    at packageResolve (node:internal/modules/esm/resolve:842:9)
    at moduleResolve (node:internal/modules/esm/resolve:915:18)
    at defaultResolve (node:internal/modules/esm/resolve:1132:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:526:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:249:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Analysis

When looking at the file in the dist folder it is indeed starting with this strange import:

// src/index.ts?sentryProxyModule=true
import "_sentry-debug-id-injection-stub";

Which lead me to this part of the plugin:

function esbuildDebugIdInjectionPlugin(logger: Logger): UnpluginOptions {

But I have to say that I'm a bit confused about its purpose, and I can't find any documentation regarding this, I must do something wrong.
I have create a repo to reproduce that: https://github.com/ex0ns/sentry-tsup (i uploaded the output in the dist folder).

I could try to work on a fix or at least provide more information on this issue, but I don't know what would be the easiest way to test or at least debug that, any pointer welcome !

I think this is related to #608 #445

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Oct 1, 2024
@lforst
Copy link
Member

lforst commented Oct 1, 2024

Thanks for the report. I'll close this in favor of an earlier issue this week #614

@lforst lforst closed this as not planned Won't fix, can't repro, duplicate, stale Oct 1, 2024
@ex0ns
Copy link
Author

ex0ns commented Oct 1, 2024

oh i missed this one, found two other related issue, thanks for pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants