This app was created to aid in a github issue, where some of us are struggling to get sourcemapping to work in Sentry with Ionic/Capacitor applications.
Created an account, organization, and Capacitor project in Sentry.
- Created a blank Ionic (v6) + Angular (v13) + Capacitor (v3) app using the Ionic CLI (
ionic start
) - Installed Sentry packages
npm install --save @sentry/capacitor @sentry/angular
- Followed Capacitor setup docs
- I put
Sentry.init()
in main.ts instead of app.module.ts - Configured a dsn (removed from this example), release, and dist. Substitue your own values to test for yourself
- I put
- Threw an error in the
ionViewDidEnter
lifecycle insrc/app/home/home.page.ts
for Sentry to log. - Did a development build of app
ionic build
to generate thewww
directory
- Created a release
sentry-cli releases new sentry-sourcemaps-issue@0.0.1
- Uploaded minified files and sourcemaps for dist
sentry-cli releases files sentry-sourcemaps-issue@0.0.1 upload-sourcemaps ./www --dist 1
- Finalized release
sentry-cli releases finalize sentry-sourcemaps-issue@0.0.1
- Ran
ionic serve
to run app locally and trigger the error
- Sentry did successfully receive the event
- Breadcrumbs and Tags look fine
- The Problem "Source code was not found" (see my event)
- Is serving the app using
ionic serve
not supported or requires special configuration over a "deployed" app?- Using
http-server
to serve up thewww
directory locally does not show "problems" in Sentry but has an entirely different stack traceionic serve
stack tracehttp-server ./www
stack trace
- Using
- Is
@sentry/tracing
required for error logging to work? The quickstart guide is confusing as some examples include the package and others don't, but my impression is that Tracing is only needed for performance logging.