onfido-sdk-ui icon indicating copy to clipboard operation
onfido-sdk-ui copied to clipboard

disableAnalytics: true causes error during error handling

Open anttilbc opened this issue 4 years ago • 4 comments

What was the expected behaviour?

Expected to get some error message after document upload. I intentionally used incorrect token to get some error. In case of incorrect token the expected error seems to be

"Connection lost Please try again"

What happened instead?

Got stuck to blank page with the loading circles. Error in console: TypeError: On is null

Version info:

  • Onfido SDK: 5.9.2
  • Browser: FF

Integration configuration:

    Onfido.init({
      useModal: false,
      disableAnalytics: true,
      token: "token",
      onComplete: function(data) {
        // callback for when everything is complete
        console.log("everything is complete")
      },
      steps: [
        'welcome',
        'document',
        {
          type: 'face',
          options: {
            uploadFallback: false
          }
        },
        'complete'
      ]
    });

Steps to reproduce:

Run onfido with the disableAnalytics: true (above configuration) and intentionally use incorrect token to cause an error.

Demo:

https://jsfiddle.net/57v1rz9s

anttilbc avatar May 28 '20 08:05 anttilbc

Hi @anttilbc, what are you passing as an invalid token? I'm unable to reproduce it by using a random string.

stefaniacardenas avatar Jun 02 '20 08:06 stefaniacardenas

Hi @stefaniacardenas, I just appended random char to a working test token but I also tested with random strings and the same happens.

I noticed that I get different error when using chrome: Uncaught TypeError: Cannot read property 'captureException' of null which actually seems to be the same error but chrome and firefox just report it differently.

It seems that it tries to capture exception for sentry but sentry is not intialised (Because of disableAnalytics I guess?)

anttilbc avatar Jun 02 '20 09:06 anttilbc

Hi @stefaniacardenas, I added jsfiddle to demo this problem: https://jsfiddle.net/57v1rz9s.

anttilbc avatar Jun 08 '20 10:06 anttilbc

Hi @anttilbc, thanks for reporting this issue. I can confirm it's a bug on our side. We will prioritise a fix for this issue in one of the upcoming releases.

stefaniacardenas avatar Jun 08 '20 10:06 stefaniacardenas