We have an Ionic Capacitor Angular App with the Crashlytics plugin installed. Since JS source maps are disabled in production, we don't get meaningful errors that happened in the webview.
Can we make sense of the Crashlytics error without sending sourcemap file to client? If not, Does including source maps has any performance effects for an Ionic App?
I checked these questions but could not find related info about Capacitor Apps.
- How to add sourcemap in React Native for Production?
- How to upload Firebase Crashlytics mapping file for React Native?
Here's how I send non-fatal errors:
import { FirebaseCrashlytics } from "@capacitor-community/firebase-crashlytics";
import * as StackTrace from "stacktrace-js";
async recordException(error: Error, message?: string) {
if (!this.platform.is("capacitor")) return;
try {
const stacktrace = await StackTrace.fromError(error);
await FirebaseCrashlytics.recordException({
message: message ?? error?.message ?? "Non-fatal error",
stacktrace,
});
} catch (error) {}
}
Here's how the report looks in production.
Relevant dependencies:
"@angular/common": "^15.2.2",
"@capacitor-community/firebase-crashlytics": "^2.0.0",
"@ionic/angular": "^6.6.1",
"@capacitor/core": "^4.7.0",