Bas van Dijk
Bas van Dijk

Reputation: 10713

Unable to access source maps in Sentry for Ionic application

I've build my Ionic project with: ionic build --prod --source-map

Then I've uploaded the sourcemaps with: npx sentry-cli releases files my-app-1.1.0 upload-sourcemaps ../sentry-source-code-1.1.0 --url-prefix 'http://localhost' (the sentry-source-code-1.1.0 folder contains the .map and .js files)

Issues show up on Sentry.io but I got this error: enter image description here

Which seems to make sense, but unfortunately Ionic / Capacitor apps are always loaded from localhost since it is a Webview container.

These files do exist in Sentry's release artifacts as well: enter image description here

Uploading without --url-prefix 'http://localhost did not change anything

How can I tell sentry to lookup the localhost files and sourcemaps in the artifacts?

Upvotes: 6

Views: 1436

Answers (2)

Kamil Ogórek
Kamil Ogórek

Reputation: 376

Prefix has to include a ~/ which is protocol matcher. Ditch http:// from the prefix and use ~/localhost instead.

Upvotes: 0

Bruno Garcia
Bruno Garcia

Reputation: 6408

My guess is that it happens because you pass --url-prefix localhost.

Try removing it.

Upvotes: 0

Related Questions