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

debugId not injected into sourcemap only source file #1681

Closed
tranan89 opened this issue Jul 11, 2023 · 11 comments
Closed

debugId not injected into sourcemap only source file #1681

tranan89 opened this issue Jul 11, 2023 · 11 comments

Comments

@tranan89
Copy link

Hi

Environment

What version of the CLI and what OS are you running?

I use this command in our dockerfile: RUN curl -sL https://sentry.io/get-cli/ | bash

Steps to Reproduce

RUN sentry-cli sourcemaps inject ${STATIC_FILES_PATH}

Expected/Actual Result

debugId is injected into server.bundle.js as expected but nothing is injected into the sourcemap. I have searched for everything containing debug as well as the id that server.bundle.js contains

server.bundle.js contains:
//# debugId=ff6bddbc-11f1-54bc-8c3a-2211c24f8f2f

Logs

The injection should be done according to the logs, but nothing seems to have been added to the sourcemap, only the regular bundle.

image image
@kamilogorek
Copy link
Contributor

Would it be feasible for you to try out the latest master build? There are some improvements around injection, and there's a chance it's already fixed.

  • run https://rustup.rs/
  • clone the repo
  • cargo build
  • ./target/debug/sentry-cli sourcemaps inject ${STATIC_FILES_PATH}

@tranan89
Copy link
Author

@kamilogorek thanks for fast response. I tried out master locally according to your instructions and then it worked 👍

Please get back once this has been released and updated in https://sentry.io/get-cli/ so I can test it in our automated workflow as well.

@hthr-lee
Copy link

Are you by chance using sentry-cli sourcemaps upload after? I noticed that sentry-cli sourcemaps inject works as expected when I run the command locally and check on my file system. But when I run upload afterwards, the debug_id in the *.map files are all removed during the rewriting sources step. I can get around this by adding the --no-rewrite option when running upload but not sure if this is going to cause other unintended side effects.

@tranan89
Copy link
Author

@hthr-lee You are completely right. In our automated workflow where it doesn't work we do upload as well without the --no-rewrite flag. I tested this locally as well now with master and it is just like you say that the uploaded sourcemap disappears during the upload unless I add --no-rewrite. And just like you I don't know if its fine to add that flag or not 😅.

I can also see the debug ids in the upload report even though they are removed from the sourcemap files that can be downloaded through the sentry ui.
image

@loewenheim
Copy link
Contributor

See #1685.

@jbub
Copy link

jbub commented Jul 19, 2023

Are you by chance using sentry-cli sourcemaps upload after? I noticed that sentry-cli sourcemaps inject works as expected when I run the command locally and check on my file system. But when I run upload afterwards, the debug_id in the *.map files are all removed during the rewriting sources step. I can get around this by adding the --no-rewrite option when running upload but not sure if this is going to cause other unintended side effects.

This seems to be exactly the case we are running into.

@AykutSarac
Copy link

--no-rewrite argument worked for me as well.

@argmichael
Copy link

See #1685.

@loewenheim Just want to make sure that this is no longer an issue and has been fixed in 2.20.0?

@AykutSarac
Copy link

I can confirm it has been fixed with 2.20.

@loewenheim
Copy link
Contributor

Excellent, thank you very much for the confirmation.

@tranan89
Copy link
Author

tranan89 commented Aug 7, 2023

Thanks for fixing 🙏
I have confirmed that it is working in our automated workflow as well now 🎉
I have been on vacation until now

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

No branches or pull requests

7 participants