sentry-capacitor
sentry-capacitor copied to clipboard
Source code was not found in ios
Environment
vue3 + capacitor
"@sentry/capacitor": "^0.9.0",
"@sentry/tracing": "^7.9.0",
"@sentry/vue": "^7.9.0",
Steps to Reproduce
import { Integrations } from '@sentry/tracing';
import * as CapacitorSentry from '@sentry/capacitor';
import * as VueSentry from '@sentry/vue';
initSentry(app, router) {
CapacitorSentry.init(
{
dsn: process.env.VUE_APP_SENTRY_DSN,
integrations: new Integrations.BrowserTracing({
routingInstrumentation: VueSentry.vueRouterInstrumentation(router),
}),
tracesSampleRate: 0.1,
environment: process.env.VUE_APP_SENTRY_ENV,
enabled: process.env.NODE_ENV === 'production',
release: process.env.VUE_APP_VERSION,
dist: process.env.VUE_APP_VERSION,
logErrors: process.env.NODE_ENV === 'production' ? false : true,
enableNative: process.env.VUE_APP_PLATFORM !== 'web',
trackComponents: true,
},
(options) => VueSentry.init({ ...options, app })
);
}
import { createApp } from 'vue';
import router from './router';
initSentry(app, router);
and upload source-map using sentry-cli
uploaded source code
Expected Result
Same result for ios and android. and sentry issues show correct information including component info
Actual Result
ios has error Source code was not found
ios sentry issue

android issue

Thanks for opening the issue :D I'll investigate it and give a response once I conclude the investigation.
Also, are both Android and iOS apps with the same release number or are they different?
Thanks for reply :)
I used same release for both ios and android
I wasn't exactly able to reproduce it, would you mind sharing a screenshot from the raw stacktrace from that issue?

Also, if possible, a repro (I found another issue that may or may not be related with the Vue stack trace)
Sorry for late 🙏 @lucas-zimerman


To fix above error I upload sourcemap with --url-prefix 'app:///capacitor://<server.hostname>/assets/
Full command
yarn sentry-cli releases files dev upload-sourcemaps ./dist/assets --url-prefix 'app:///capacitor://<server.hostname>/assets/' --org <organization> --project <project> --auth-token <auth-token> --dist dev

Oh!! sentry issue find sourcemap but cannot un-minity 😂
But there are sourcemap

@lucas-zimerman 🙏 why un-minify??
android and web is fine

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 🥀
would you mind giving it a try to the latest version of sentry/cli with the given command?
yarn sentry-cli sourcemaps inject --org <organization> --project <project> ./www && sentry-cli sourcemaps upload --org sentry-sdks --project aspnet-core ./www
There's no need to specify the release nor dist since the new cli has a better way of linking the sourcemaps.
Ideally that stacktrace shouldn't show as app:// if the source file exists on the dist folder, is this still happening and is this a debug or release build?
EDIT: Additionally, the next version will contain fixes that will improve the stacktraces on Capacitor :)
Oh, sorry...!
We finally know the cause.
According to my CI process, the android-related logic was uploading the source map to Sentry, but the ios-related logic was not uploading the source map to Sentry.
So, the problem was caused by the name of the dist file and the name of the source map not matching in the case of IOS.
I changed the release and dist to 0.0.1.androd 0.0.1.ios so that the source map was uploaded twice.
It works on ios too!