ReallySmallSoftware / cordova-plugin-firebase-crashlytics

Google Firebase Crashlytics Cordova plugin
Other
33 stars 80 forks source link

Javascript crashes not being reported on FireBase console #25

Closed Gerarduu closed 4 years ago

Gerarduu commented 5 years ago

Expected Behavior

To show a Javascript crash on the Firebase Console.

Actual Behavior

Not showing a Javascript crash on the Firebase Console.

Steps to Reproduce the Problem

If i do a manual log, for example:

var crashlytics = FirebaseCrashlytics.initialise();
crashlytics.logException("my caught exception");

Or if, for example I simulate a crash:

crashlytics.crash();

It works correctly.

But if I force a crash with Javascript, it doesn't show anything on the console. I'm putting the code on the beginning of my app. It crashes and it shows the crash on the local logs, but when I go to the Firebase Console, it not shows the crash.

This is what I write to force a crash:

var arr = [1,2,3,4];
var a = arr[5].test;

In my chrome console it shows:

Uncaught TypeError: Cannot read property 'test' of undefined
    at init (app.js:1904)
    at Channel.Initialize (app.js:2717)
    at Channel.subscribe (cordova.js:772)
    at document.addEventListener (cordova.js:129)
    at HTMLDocument.document.addEventListener (cordova.js:1694)
    at LoadDevice (app.js:1549)
    at f (head.load.min.js:2)
    at head.load.min.js:2
    at head.load.min.js:2
    at HTMLScriptElement.o (head.load.min.js:2)

And this message should appear to the Firebase Console, but it doesn't appear.

Specifications

ReallySmallSoftware commented 4 years ago

I assume you are restarting the app? Also, I think in JS you will need to install a global error handler to catch that error and log it as the app itself isn't actually crashing. It needs to crash in the native code to be automatically reported.

ReallySmallSoftware commented 4 years ago

No response so closing issue

Ndrou commented 4 years ago

I have the same error.

When i simulate a crash, the crash is reported into crashlytics console.

And nothing is reported into crashlytics console when i do

crashlytics.logException(error.stack);

I use a global handler in Ionic to send errors.