Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Cannot read properties of undefined (reading 'open') #179

Closed
gregor-srdic opened this issue Sep 16, 2021 · 1 comment
Closed

Cannot read properties of undefined (reading 'open') #179

gregor-srdic opened this issue Sep 16, 2021 · 1 comment

Comments

@gregor-srdic
Copy link

Describe the problem

I have recently upgraded the android app to cordova-android 10 and now I am encountering the following error when trying to login via @auth0/cordova using google social login provider

ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'open')
TypeError: Cannot read properties of undefined (reading 'open')
    at WebView.push../node_modules/@auth0/cordova/src/agent/webview.js.WebView.open (vendor.js:132166)
    at vendor.js:132398
    at vendor.js:132139
    at Object.callbackFromNative (cordova.js:295)
    at processMessage (cordova.js:1134)
    at processMessages (cordova.js:1157)
    at ZoneDelegate.invoke (polyfills.js:10375)
    at Object.onInvoke (vendor.js:95244)
    at ZoneDelegate.invoke (polyfills.js:10375)
    at Zone.run (polyfills.js:10101)
    at resolvePromise (polyfills.js:10958)
    at polyfills.js:11030
    at ZoneDelegate.invokeTask (polyfills.js:10408)
    at Object.onInvokeTask (vendor.js:95232)
    at ZoneDelegate.invokeTask (polyfills.js:10408)
    at Zone.runTask (polyfills.js:10158)
    at drainMicroTaskQueue (polyfills.js:10624)
    at ZoneTask.invokeTask [as invoke] (polyfills.js:10506)
    at invokeTask (polyfills.js:12034)
    at HTMLElement.globalZoneAwareCallback (polyfills.js:12065)

What was the expected behavior?

New window should appear - where user should be able to enter google account credentials and then log in to the app.

Reproduction

      import Auth0Cordova from '@auth0/cordova';

      const auth0 = new Auth0Cordova({
        domain: this.auth0Config.domain,
        clientId: this.auth0Config.client.clientId,
        packageIdentifier:
          this.environment.getEnvironmentConfig().packageIdentifier,
      });
      const options = {
        scope: AUTH0_CONSTANTS.scope,
        connection: provider,
        audience: this.auth0Config.audience,
        prompt: 'login',
        max_age: 0,
      };

Environment

  • 0.4.4
  • Ionic Framework
  • cordova-android 10.1.1
@gregor-srdic
Copy link
Author

Problem was with cordova-plugin-safariviewcontroller on android target sdk 30 - EddyVerbruggen/cordova-plugin-safariviewcontroller#179 and was solved by adding the following to android platform element inside config.xml

<config-file parent="/manifest" target="AndroidManifest.xml">
            <queries>
                <intent>
                    <action android:name="android.support.customtabs.action.CustomTabsService" />
                </intent>
            </queries>
        </config-file>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant