Ionic-framework: ERROR Error: Uncaught (in promise): invalid views to insert

Created on 3 Feb 2018  路  2Comments  路  Source: ionic-team/ionic-framework

Ionic version: (check one with "x")
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[ x ] 3.x
[ ] 4.x

I'm submitting a ... (check one with "x")
[ x ] bug report
[ ] feature request

Current behavior:

Basicly i have a this.nav.setRoot(page); to navigate between pages.

This app I have many pages , but just for a specific page, when i go in there, navigate to another and come back, it gives me this error.

I found a way to reproduce in my repo, now its easy to debug if you can point me where i should look to go over this bug.

Expected behavior:

It should navigate to another page as happens with other components in same app.

Steps to reproduce:

Really dont know, its totally intermitent and happens in just one view. I tryed remove all the code (html/js) and leave like a very dummy component, but even thought receiving this same error.

Related code:

What i could debug is that in nav-controller-base.js, this variable is returning null: enteringView = _this._getEnteringView(ti, leavingView); . What happens is that this loads the page, but just after make a call to the function NavControllerBase.prototype._nextTrns again passing a empty view.

captura de tela 2018-02-02 as 10 33 05 pm

captura de tela 2018-02-02 as 9 31 54 pm

core.js:1350 ERROR Error: Uncaught (in promise): invalid views to insert
    at c (polyfills.js:3)
    at Object.reject (polyfills.js:3)
    at NavControllerBase._fireError (nav-controller-base.js:223)
    at NavControllerBase._failed (nav-controller-base.js:216)
    at nav-controller-base.js:263
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (core.js:4629)
    at t.invoke (polyfills.js:3)
    at r.run (polyfills.js:3)
    at polyfills.js:3

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

local packages:

    @ionic/app-scripts : 1.1.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v6.11.2
    npm  : 3.10.3
    OS   : macOS High Sierra

Misc:

    backend : pro

Most helpful comment

My gosh.. found out how to solve this...

Basicly.. in routing, you cannot end the url with the slash

WRONG
{ component: BuyersComponent, name: 'BuyersComponent', segment: 'buyers/' },

CORRECT
{ component: BuyersComponent, name: 'BuyersComponent', segment: 'buyers' },

the problem is the last slash: _segment: 'buyers/'_

All 2 comments

My gosh.. found out how to solve this...

Basicly.. in routing, you cannot end the url with the slash

WRONG
{ component: BuyersComponent, name: 'BuyersComponent', segment: 'buyers/' },

CORRECT
{ component: BuyersComponent, name: 'BuyersComponent', segment: 'buyers' },

the problem is the last slash: _segment: 'buyers/'_

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vswarte picture vswarte  路  3Comments

alan-agius4 picture alan-agius4  路  3Comments

BilelKrichen picture BilelKrichen  路  3Comments

daveshirman picture daveshirman  路  3Comments

masimplo picture masimplo  路  3Comments