In my (relatively) fresh Ionic 3 app I get the following error:
ERROR Error: Uncaught (in promise): invalid link: MainPage
at c (polyfills.js:3)
at Object.reject (polyfills.js:3)
at NavControllerBase._fireError (nav-controller-base.js:322)
at NavControllerBase._failed (nav-controller-base.js:310)
at nav-controller-base.js:365
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.es5.js:3890)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
The app was running fine, when I wanted to enable deep links. As suggested I added IonicPage
to my page components. I basically ended up enabling lazy loading, as I followed every advice or tutorial I could find about IonicPage
.
The error does not really give any guidance to the actual problem. So I can just guess, that something is wrong in my app.ts
:
@Component({
templateUrl: 'app.html'
})
export class App {
rootPage: string = MenuPageName;
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
});
}
}
Based on which JS files are loaded, it seems as if lazy loading is working now. Sadly, I can’t get rid of this error. I tried a lot of things from the following links:
- Ionic Uncaught (in promise): invalid link,
- Lazy load pages random error:ERROR Error: Uncaught (in promise): invalid link:
- https://forum.ionicframework.com/t/solved-ionic-lazy-loading-invalid-link-tabspage/88021/20
Nothing helped, so finally I am here to ask you for help. I created a github repo, to demonstrate the problem.
It would be great to get some help here :)