sentry-cordova icon indicating copy to clipboard operation
sentry-cordova copied to clipboard

Source code was not found if JS file has relative path

Open expcapitaldev opened this issue 2 years ago • 10 comments

Environment

that cordova plugin with version 1.0.3 Env: SENTRY_SKIP_AUTO_RELEASE= true SENTRY_SKIP_WIZARD=true sentry/cli": "2.5.0" I use sentry-cli with next steps: cd to application folder, where I will have next folders: platforms/ <-- ios and android here plugins/ www/

const iOSPath = [absolutePath]+platforms/ios/www const androidPath = [absolutePath]+platforms/android/app/src/main/assets/www

sentry-cli releases new [name]@[version] sentry-cli releases files [name]@[version] upload-sourcemaps --url-prefix=['test' or 'production' value here, because without that for android we will have buildVersion] [iOSPath or androidPath] sentry-cli releases finalize [name]@[version]

I have real good path to files after release: sentry3 so, path created from www/ folder and it is expected case, all is ok

all is good and I see all native and JS errors but I have next error if I have relative path to any JS files in stacktrace: sentry1 we have good stacktrace, see: sentry2 olso, I checked stacktrace.frame I found bug in Sentry. Of course error in sentry-cordova/dist/js/sentry-cordova.bundle.js after build but see code here: https://github.com/getsentry/sentry-cordova/blob/main/src/js/normalize.ts#L26 it is mean we will remove relative path to JS file and it is unexpected case, see: sentry5 but after sentry release we wait relative path to file

olso we will not have real good stacktrace for cordova JS files and all other JS files too because they have relative path

sentry7

Steps to Reproduce

create any error with stacktrace with JS files with relative path

Expected Result

we do not need to see error in sentry with "Source code not found" for relative JS files

Сonclusion

So, pls create new hotfix with that, because we can not change that if we add for example RewriteFramesIntegration too because we will have stacktrace frame after that changes (we will have filename after your function normalizeUrl, see https://github.com/getsentry/sentry-cordova/blob/main/src/js/normalize.ts#L26) olso pls create unit test for that from your side Thanks

expcapitaldev avatar Sep 14 '22 07:09 expcapitaldev

Hi, could you try running SentryCLI with the --rewrite parameter?

example: sentry-cli releases -o myorg -p myproject files 1.0.8 upload-sourcemaps www/build --rewrite

EDIT: Additionally, it would help alot if you uploaded a simple sample app for this issue.

lucas-zimerman avatar Sep 15 '22 14:09 lucas-zimerman

@lucas-zimerman thank you for your response, but:

  1. how rewrite parameter can help if rewrite parameter enabled by default (it is imformation from your documentation) ?
  2. how simple app can help ? Do you think that event will be uploaded with relative in sample app? waiting response from your side, I am real want to help that plugin ti fix any issue and use your product.

expcapitaldev avatar Sep 15 '22 16:09 expcapitaldev

Hi expcapitaldev.

  1. a repro app helps a lot by helping us to understand where exactly the problem is, if it's something on the SDK itself, Sentry CLI or some user configuration issue.

lucas-zimerman avatar Sep 19 '22 14:09 lucas-zimerman

@lucas-zimerman hi did you check that case? You had to emulate any JS error in any JS file with relative path from root folder www. We are waiting response from your side more than 8 days and as I understood you did not check that easy case from your side ? We are using your product and I did not see any activity from your side, but you can spent for that case 5 minutes

expcapitaldev avatar Sep 22 '22 06:09 expcapitaldev

@lucas-zimerman hi, any updates?

expcapitaldev avatar Sep 27 '22 09:09 expcapitaldev

@lucas-zimerman hi, any updates?

Sorry, I didn't have a chance to check this issue (if you would like to speed up this step you can contact the Sentry support)

So far this is what I have found: I had issues with it but due to the dist not maching the sourcemaps image With the correct dist set, it was able to find the files image image

But in this case I used the default auto release integration, there's probably some additional steps for sentry cli to behave the same by removing the absolute path

lucas-zimerman avatar Sep 28 '22 13:09 lucas-zimerman

@lucas-zimerman hi, thanks for feedback as I understood you did not check steps which I provided, and I think you found issue , yep?

expcapitaldev avatar Sep 29 '22 09:09 expcapitaldev

@lucas-zimerman hi, thanks for feedback as I understood you did not check steps which I provided, and I think you found issue , yep?

Correct, I used the Auto release feature (that uses Sentry CLI under the hood) to verify if it was broken or not (Otherwise I believe there would be more users complaining about it). Since the same is working, I'll verify what's going on the auto release in order to correctly upload the sourcemaps.

lucas-zimerman avatar Oct 04 '22 13:10 lucas-zimerman

@lucas-zimerman thanks a lot, waiting response from your side

expcapitaldev avatar Oct 06 '22 06:10 expcapitaldev

@lucas-zimerman hi, did you have time to check it? Can you describe your next steps with issue ?

expcapitaldev avatar Oct 12 '22 08:10 expcapitaldev

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Nov 03 '22 00:11 github-actions[bot]

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Nov 28 '22 00:11 github-actions[bot]

looks like Sentry team do not want to fix that critical bug for my opinion

expcapitaldev avatar Nov 28 '22 06:11 expcapitaldev

any updates here?

expcapitaldev avatar Jan 30 '23 15:01 expcapitaldev

we pay money for sentry created bug with full description shown line with bug 5 month without any hotfix/acitivity the best SDK

expcapitaldev avatar Feb 12 '23 09:02 expcapitaldev

ping

expcapitaldev avatar May 18 '23 13:05 expcapitaldev

https://github.com/getsentry/sentry-cordova/issues/284#issuecomment-1260888506

Hi @lucas-zimerman I would like some help to make this works in my Sentry project

  • my stack trace show all files with app:///filename.js in the begin of the file and my sourcemaps start with ~/filename.js as well
  • But in my issue Section my stack trace do not Link to SourceMap as you show in your images

elfiservice avatar Jun 14 '23 15:06 elfiservice

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Dec 16 '23 00:12 github-actions[bot]

nothing changed

expcapitaldev avatar Dec 19 '23 10:12 expcapitaldev

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Jan 13 '24 00:01 github-actions[bot]