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

Source code was not found in ios

Open sawaca96 opened this issue 3 years ago • 3 comments

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 image

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

image image

android issue

image image

sawaca96 avatar Aug 08 '22 07:08 sawaca96

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?

lucas-zimerman avatar Aug 12 '22 09:08 lucas-zimerman

Thanks for reply :)

I used same release for both ios and android

sawaca96 avatar Aug 12 '22 10:08 sawaca96

I wasn't exactly able to reproduce it, would you mind sharing a screenshot from the raw stacktrace from that issue? image

Also, if possible, a repro (I found another issue that may or may not be related with the Vue stack trace)

lucas-zimerman avatar Aug 29 '22 13:08 lucas-zimerman

Sorry for late 🙏 @lucas-zimerman

image

sawaca96 avatar Dec 05 '22 00:12 sawaca96

image

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

image

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

But there are sourcemap

image

@lucas-zimerman 🙏 why un-minify??

android and web is fine

image image

sawaca96 avatar Feb 01 '23 12:02 sawaca96

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 May 30 '23 00:05 github-actions[bot]

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 :)

lucas-zimerman avatar Oct 27 '23 03:10 lucas-zimerman

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!

sawaca96 avatar Feb 08 '24 00:02 sawaca96