ionic-framework: Invalid views to insert using lazy loading with last nightly

Ionic version: (check one with “x”) [ ] 1.x [ ] 2.x [ ] 3.x

I’m submitting a … (check one with “x”) [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior: On last nightly which should resolve this #11168 now there are several other errors, like this:

Runtime Error
Uncaught (in promise): invalid views to insert
Stack
Error: Uncaught (in promise): invalid views to insert
    at d (http://localhost:8100/build/polyfills.js:3:3991)
    at l (http://localhost:8100/build/polyfills.js:3:3244)
    at Object.reject (http://localhost:8100/build/polyfills.js:3:2600)
    at NavControllerBase._fireError (http://localhost:8100/build/main.js:46751:16)
    at NavControllerBase._failed (http://localhost:8100/build/main.js:46739:14)
    at http://localhost:8100/build/main.js:46794:59
    at t.invoke (http://localhost:8100/build/polyfills.js:3:11562)
    at Object.onInvoke (http://localhost:8100/build/main.js:4644:37)
    at t.invoke (http://localhost:8100/build/polyfills.js:3:11502)
    at n.run (http://localhost:8100/build/polyfills.js:3:6468)
    at http://localhost:8100/build/polyfills.js:3:3767
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:12256)
    at Object.onInvokeTask (http://localhost:8100/build/main.js:4635:37)
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:12177)
    at n.runTask (http://localhost:8100/build/polyfills.js:3:7153)

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

    Cordova CLI: 6.5.0 
    Ionic Framework Version: 3.0.1-201704252003
    Ionic CLI Version: 3.0.0-beta7
    ios-deploy version: Not installed
    ios-sim version: Not installed
    OS: Linux 4.10
    Node Version: v6.10.2
    Xcode version: Not installed

P.S. sorry guys, bu it becomes really frustrating handling with LazyLoading router. 😢

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 6
  • Comments: 48 (22 by maintainers)

Most upvoted comments

All,

We are doing a refactor of navigation right now to better facilitate lazy loading. We’ll make sure this bug is resolved with the changes.

Thanks, Dan

This problem seems to have an easy fix. I’m using it without problems: Go to your-project/node_modules/ionic-angular/navigation and open deep-linker.js Then search for nav.push(segment.component. In version 3.1.1 this is on line 428. Modify this line: nav.push(segment.component, segment.data, { … so it will look like this: nav.push(segment.component || segment.name, segment.data, {

This is one of this new BUG we have from latest releases this night: https://github.com/driftyco/ionic-app-scripts/issues/927

This are other BUGS which was closed but are not resolved https://github.com/driftyco/ionic-app-scripts/issues/898 https://github.com/driftyco/ionic-app-scripts/issues/877 https://github.com/driftyco/ionic-app-scripts/issues/911

This ISSUE is still there and we can not resolve it, but it is not possibile to reproduce it on a new ENVIRONMENT https://github.com/driftyco/ionic-app-scripts/issues/893

THIS ISSUES should be closed on 3.1.0 but as we can not migrate to 3.1.0 we can not close them and thest them https://github.com/driftyco/ionic/issues/11168 https://github.com/driftyco/ionic/issues/11090

There are other problems I tried to discuss on this PR https://github.com/driftyco/ionic/pull/11128#issuecomment-294958625 As you can see for the last two messages version 3.1.0 probably close the promise bug but opens me a new SEVERE bug on setting the new page on a ion-nav

This are only a SET of BUGs we have and we opened and which are open.

Honestly the thing is, this are not css or other bugs we can handle with some simple workarounds. This are framework problems which stops us to work on production and also on dev.

I hope we can help you as much as possible do makes it work.

THX

And as you can see, this issue is now on the 3.2.0 milestone 🎉

long and painful story

@ionic team was you able to reproduce the bug with my repro?

Not sure if it only fixes it here for me or could help anyone else but after getting this error

***Runtime Error ***Uncaught (in promise): invalid views to insert

I did the following 2 steps and all is working fine now… That error has stopped for now.

  1. I went thru and imported NavParams to every pages’ .ts file even though I am not using NavParams and injected into all constructors. YES vs code Typescript does not like that I am not actually using NavParams so puts a squiggle under the import but its ok because its just a warning/help squiggle

  2. in the module.ts for each page I noticed some did and some did not have a comma after the page declaration ( probably made with different versions of ionic generate over the last few months?) anyway I added that comma back in all the files that didn’t have it @NgModule({ declarations: [ HomePage, <- that comma right there ******* ],…

Could just be a fluke… but 1 or both of those things combined has everything working again.

I have same problem in lazyload mode Error: Uncaught (in promise): removeView was not found at d (http://localhost:8100/build/polyfills.js:3:3991) at l (http://localhost:8100/build/polyfills.js:3:3244) at Object.reject (http://localhost:8100/build/polyfills.js:3:2600) at Tab.NavControllerBase._fireError (http://localhost:8100/build/main.js:44534:16) at Tab.NavControllerBase._failed (http://localhost:8100/build/main.js:44522:14) at http://localhost:8100/build/main.js:44577:59 at t.invoke (http://localhost:8100/build/polyfills.js:3:11562) at Object.onInvoke (http://localhost:8100/build/main.js:4623:37) at t.invoke (http://localhost:8100/build/polyfills.js:3:11502) at n.run (http://localhost:8100/build/polyfills.js:3:6468) at http://localhost:8100/build/polyfills.js:3:3767 at t.invokeTask (http://localhost:8100/build/polyfills.js:3:12256) at Object.onInvokeTask (http://localhost:8100/build/main.js:4614:37) at t.invokeTask (http://localhost:8100/build/polyfills.js:3:12177) at n.runTask (http://localhost:8100/build/polyfills.js:3:7153)

Ionic App Scripts: 1.3.4 Angular Core: 4.0.2 Angular Compiler CLI: 4.0.2 Node: 7.7.1 OS Platform: Windows 10 Navigator Platform: Win32 User Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1

Also seeing this randomly, as well:

Error: Uncaught (in promise): removeView was not found
    at d (http://localhost:8100/build/polyfills.js:3:3991)
    at l (http://localhost:8100/build/polyfills.js:3:3244)
    at l (http://localhost:8100/build/polyfills.js:3:2930)
    at http://localhost:8100/build/polyfills.js:3:3758
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:12256)
    at Object.onInvokeTask (http://localhost:8100/build/main.js:4469:37)
    at t.invokeTask (http://localhost:8100/build/polyfills.js:3:12177)
    at n.runTask (http://localhost:8100/build/polyfills.js:3:7153)
    at a (http://localhost:8100/build/polyfills.js:3:2312)```

I had the same problem, upgraded to ionic-angular 3.3 and still fails. Patched line 428 of deep-linker.sj and the problem solved (BOAndrew post)

Yea, to bug was in milestone for 3.2 and 3.3 but today was released 3.3 and the bug wasn’t resolved. 😢

We have the same error as, @shprink. This bug is a long and painful story!

Yes please!!!

@BOAndrew thanks for the solution, it works great forme. I hope the IONIC team resolve this issue in the next release.

Great thx a lot!! We can not update ionic before the bug is resolved. We as others are stille there on 3.0.1. I hope my repo can help you to reproduce the error! Thx

Hello, all! Thanks for all the input, we greatly appreciate you guys concerns and are evaluating all this info as I write this. As I said before we are hard at work on getting our lazy loading implementation polished and ready for the big time. We are aware of some navigation and build issues with lazy loading at the moment which is why we have not pushed it as the default yet. Expect updates on all this soon and again, thanks for using Ionic everyone!

@jgw96 @brandyscarney Has someone a solutions for this BUG?? invalid views to insert this bug is cause many other bugs or side effects!

Can you give this a priority?