sentry-cordova
sentry-cordova copied to clipboard
Source code was not found if JS file has relative path
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:
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:
we have good stacktrace, see:
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:
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
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
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 thank you for your response, but:
- how rewrite parameter can help if rewrite parameter enabled by default (it is imformation from your documentation) ?
- 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.
Hi expcapitaldev.
- 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 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
@lucas-zimerman hi, any updates?
@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
With the correct dist set, it was able to find the files
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 hi, thanks for feedback as I understood you did not check steps which I provided, and I think you found issue , yep?
@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 thanks a lot, waiting response from your side
@lucas-zimerman hi, did you have time to check it? Can you describe your next steps with issue ?
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 🥀
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 🥀
looks like Sentry team do not want to fix that critical bug for my opinion
any updates here?
we pay money for sentry created bug with full description shown line with bug 5 month without any hotfix/acitivity the best SDK
ping
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
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 🥀
nothing changed
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 🥀