-
Notifications
You must be signed in to change notification settings - Fork 37
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
Could not resolve _sentry-release-injection-stub
#614
Comments
Hi, would you mind providing a small repro example so we can take a closer look? Thanks! |
Hi @lforst, I've created a test repo here: Although I don't have a test sentry org & auth token to replace to the config so I can't test if it's actually working. You can fill in the sentry authentication key in |
Thanks! We're a bit busy this week so I need to put this on the backlog. Feel free to investigate on your own in the meantime. |
Following my investigation on #616 (thanks again for linking me to this issue), which is based on tsup (using esbuild under the hood), it seems that the I would believe that a fix could be to replace all occurrences of My current workaround is to add this to my noExternal: ["_sentry-debug-id-injection-stub"], Which forces esbuild to consider the file as a local file. the generated file looks correct: // _sentry-release-injection-stub
var _global = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
_global.SENTRY_RELEASE = { id: "012ec3c3a45c4f3d921e71aeb5a29abeeaab6b98" };
// sentry-debug-id-stub:_sentry-debug-id-injection-stub?sentry-module-id=996d7825-4b8c-4053-a10c-9e9232bbeefb
!function() {
try {
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "5ea6224e-be36-45c9-b0c7-ea8b9fb1af0f", e._sentryDebugIdIdentifier = "sentry-dbid-5ea6224e-be36-45c9-b0c7-ea8b9fb1af0f");
} catch (e2) {
}
}();
// src/instrument.ts I don't know when this broke and if esbuild changed the way plugins are working but I would be glad to provide you more information if needed. |
@ex0ns that is some nice investigation. Thanks! A bit of an annoying nuance that esbuild has. Do you feel like contributing the change or should we take care of it? Maybe you're able to try it out for your setup and verify whether it works! |
I will try to contribute and add a fix, but I can't promise anything yet. Edit:
I don't know this codebase (or tsup's) well enough yet to think of a fix, but my guess is that |
Re the first issue:
The unlucky thing is that it needs to be absolute for older eslint versions 🤔 Maybe we just drop support and release a major. |
Hi, I'm using
@sentry/[email protected]
with@angular-builders/custom-esbuild@18
and the Angular build failed with this error:I think it could be that the newer version of esbuild some how break this line:
sentry-javascript-bundler-plugins/packages/esbuild-plugin/src/index.ts
Line 15 in 75a5d1d
The only workaround that I could find is to set
release.inject
tofalse
which would make the build succeed but then there's nodebugID
injected to the build output & sosentry-esbuild-plugin
would just ignore and not upload any of our code artifacts.The text was updated successfully, but these errors were encountered: