Ionic 3.6.0, Ionic SuperTabs: getActiveChildNavs of undefined

Hi,

since the ionic 3.6.0 update i got a error that confusing me. I dont know why this error comes. Before the update all is working fine.

When i click a menu item on the sidemenu i get this error message below.
On the Page i use the Ionic 2 Super Tabs. It is only on this Page.

  openPage(component) {
    this.menu.close();
    if (this.nav.getActive().component != component) {
      this.nav.setRoot(component);
      /*this.app.getRootNav().setRoot(page.component, {}, {
        animate: true,
        direction: 'forward'
      });*/
    }
  }
Uncaught (in promise): TypeError: Cannot read property 'getActiveChildNavs' of undefined
TypeError: Cannot read property 'getActiveChildNavs' of undefined
    at findTopNavs (http://localhost:8100/build/vendor.js:23742:41)
    at http://localhost:8100/build/vendor.js:23748:44
    at Array.forEach (<anonymous>)
    at findTopNavs (http://localhost:8100/build/vendor.js:23747:19)
    at http://localhost:8100/build/vendor.js:23748:44
    at Array.forEach (<anonymous>)
    at findTopNavs (http://localhost:8100/build/vendor.js:23747:19)
    at http://localhost:8100/build/vendor.js:23464:32
    at Map.forEach (native)
    at App.getActiveNavContainers (http://localhost:8100/build/vendor.js:23463:24)

hope someone can help.

The Page is LazyLoad.


Are you sure you didn’t update to 3.5 instead of 3.6? Might want to check your Ionic Info.

cli packages: (C:\Users\Daniel\Desktop\Alles\Projekte\Netz-App\netz-app\node_modules)

    @ionic/cli-plugin-ionic-angular : 1.4.1
    @ionic/cli-utils                : 1.7.0
    ionic (Ionic CLI)               : 3.7.0

local packages:

    @ionic/app-scripts : 2.1.3
    Ionic Framework    : ionic-angular 3.6.0

System:

    Android SDK Tools : 25.2.3
    Node              : v8.2.1
    OS                : Windows 10
    npm               : 5.3.0

Hm. It’s an echo of a bug in a previous version that got fixed. Maybe the devs unfixed it. I think you should check issues on Github. This sounds a lot like a previous known issue.

1 Like

i only have this problem when i set the Root from the sidemenu before the bug was on ever set root. i think it is a new bug

Fixed temporarily by using other versions.

npm install ionic-angular@3.5.0 ionic2-super-tabs@3.0.2

Hopefully it will be fixed soon :slightly_smiling_face:

Same problem here

cli packages: (E:\ResenhaVirtual\node_modules)

@ionic/cli-plugin-cordova       : 1.6.2
@ionic/cli-plugin-ionic-angular : 1.4.1
@ionic/cli-plugin-proxy         : 1.4.1
@ionic/cli-utils                : 1.7.0
ionic (Ionic CLI)               : 3.7.0

global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts : 1.3.12
Cordova Platforms  : android 6.2.3 browser 4.1.0
Ionic Framework    : ionic-angular 3.5.0

System:

Android SDK Tools : 25.2.5
Node              : v6.10.3
OS                : Windows 10
npm               : 5.2.0
    "ionic2-super-tabs": "^4.0.1",

same problem here.

cli packages: (E:\Mobile Source\mraMfile2\node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 3.1.0
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 25.2.5
Node              : v6.9.2
npm               : 5.5.1
OS                : Windows 8.1

Environment Variables:

ANDROID_HOME : C:\Program Files (x86)\Android\android-sdk

Misc:

backend : legacy

ionic2-super-tabs 4.1.5

Already found the solution but I had to change the code inside components/super-tabs.ts
Look for
getActiveChildNavs(): NavigationContainer[] { return [this._tabs[this.selectedTabIndex]]; }
I tried console.log for this.selectedTabIndex and it returned -1 when you switch between ionic tabs and super-tabs page, so I changed it to

getActiveChildNavs(): NavigationContainer[] { if (this.selectedTabIndex < 0) { this.selectedTabIndex = 0; } return [this._tabs[this.selectedTabIndex]]; }
And now it works

1 Like

works fine…Thank you

I am using “ionic2-super-tabs”: “^5.0.2”, and here is my super-tabs.js

SuperTabsComponent.prototype.getActiveChildNavs = function () {
        if (this.selectedTabIndex < 0) {
            this.selectedTabIndex = 0;
        }
        return [this._tabs[this.selectedTabIndex]];
    };

But still i am getting

Error: Uncaught (in promise): TypeError: Cannot read property 'getActiveChildNavs' of undefined
TypeError: Cannot read property 'getActiveChildNavs' of undefined
    at findTopNavs (http://localhost:8100/build/vendor.js:22399:25)
    at http://localhost:8100/build/vendor.js:22405:27
    at Array.forEach (<anonymous>)
    at findTopNavs (http://localhost:8100/build/vendor.js:22404:19)
    at http://localhost:8100/build/vendor.js:22405:27
    at Array.forEach (<anonymous>)
    at findTopNavs (http://localhost:8100/build/vendor.js:22404:19)
    at http://localhost:8100/build/vendor.js:22405:27
    at Array.forEach (<anonymous>)
    at findTopNavs (http://localhost:8100/build/vendor.js:22404:19)
    at c (http://localhost:8100/build/polyfills.js:3:19752)
    at new t (http://localhost:8100/build/polyfills.js:3:21532)
    at __awaiter (http://localhost:8100/build/vendor.js:57894:12)
    at SuperTabsComponent.ngAfterViewInit (http://localhost:8100/build/vendor.js:58115:16)
    at callProviderLifecycles (http://localhost:8100/build/vendor.js:13122:18)
    at callElementProvidersLifecycles (http://localhost:8100/build/vendor.js:13089:13)
    at callLifecycleHooksChildrenFirst (http://localhost:8100/build/vendor.js:13072:29)
    at checkAndUpdateView (http://localhost:8100/build/vendor.js:14227:5)
    at callViewAction (http://localhost:8100/build/vendor.js:14569:21)
    at execComponentViewsAction (http://localhost:8100/build/vendor.js:14501:13)