sentry-cli strips out "//" from --url-prefix "app://"

Created on 29 May 2018  路  10Comments  路  Source: getsentry/sentry-cli

Hi,

I'm using ionic for my mobile app.
I can get bugs reported to sentry.
I can get sourcemap uploaded.
But the exception stack doesn鈥檛 link with sourcemaps.

I suspect it's to do with the urls used in exception stack.

app:///vendor.js in viewWrappedDebugError at line 9857:15
app:///vendor.js in callWithDebugContext at line 15103:15
app:///vendor.js in Object.debugHandleEvent [as handleEvent] at line 14680:12
app:///vendor.js in dispatchEvent at line 10057:25
app:///vendor.js at line 10671:38
app:///vendor.js in HTMLButtonElement.<anonymous> at line 40187:53
app:///polyfills.js in t.invokeTask at line 3:15660
app:///vendor.js in Object.onInvokeTask at line 4973:33
app:///polyfills.js in t.invokeTask at line 3:15581
app:///polyfills.js in r.runTask at line 3:10834
app:///polyfills.js in e.invokeTask [as invoke] at line 3:16794
app:///polyfills.js in p at line 2:27648
app:///polyfills.js in HTMLButtonElement.v at line 2:27893

So, suspecting it's to do with the sourcemap url, I tried to set --url-prefix with "app://", but sentry-cli strips out the "//".

.\node_modules\.bin\sentry-cli releases files 0.0.1 upload-sourcemaps --url-prefix 'app://'
 .\.sourcemaps\ .\www\build\
> Analyzing 8 sources
> Adding source map references
> Uploading source maps for release 0.0.1
> app:/vendor.js.map

Has anyone came across this before?

bug releases

Most helpful comment

Same problem here but on MacOS

All 10 comments

I did not verify this yet but I suspect we might have issues with windows paths here.

@Anakin-Hao same for me: sourcemaps are uploaded under the right app version, but I only get not-mapped sources from sentry error logs.

Using the sentry-cordova sdk the artifacts are automatically uploaded as ~/main.js, ~/main.js.map, etc..

As a result, this is my situation on the sentry dashboard (and I also suspect it's all about the prefix):
image

Therefore, when I try to manually upload the artifacts, prefixing by --url-prefix app:///, all I get is the prefix app:/

Give a look at the sentry-cli's source code:

let url_prefix = matches
        .value_of("url_prefix")
        .unwrap_or("~")
        .trim_right_matches("/");

Maybe it helps to focus on the "problem".

Same problem here but on MacOS

Had the same problem, tried to relaunch the sourcemap upload without any url prefix, causing this to setting a default "~" url prefix and it worked for me

Hello, any updates here? I have similar problem for react-native on expokit.

Has anyone found a workaround for this?

I have a fix in #599 that adds support for --url-prefix=app:///. Notice the triple slashes.

yarn add https://github.com/getsentry/sentry-cli.git#master

npx sentry-cli releases -o myorg -p myproj files releasename upload-sourcemaps path/to/www --rewrite --url-prefix=app:///

# etc...

app:/96.e6bf96c1f971992c4ecc.js.map
app:/97.1b437eb4e0b5faf1086a.js.map
app:/98.baaa2086655b473c8990.js.map
app:/99.ac68f40ab713351ca28a.js.map

Maybe installing from master doesn't work like that?

Sadly, no. You鈥檒l have to wait for the next release or build the binary yourself if you鈥檇 like to try it out immediately.

We are going to release on Monday.

Seems to be fixed in 1.47.2
Thanks all!

Was this page helpful?
0 / 5 - 0 ratings