Ionic Uncaught (in promise): invalid link

uncaught (in promise): invalid link homepage in ionic 3
uncaught (in promise): invalid link ionic 3
invalid link meaning
ionic runtime error uncaught in promise invalid link
invalid link error

i have propably problem with this.nav.push in Ionic. I have done a login/registration page but when i login i get this error message. I have to add code from login.ts and e.g home.ts(which is main page) ?

Runtime Error Uncaught (in promise): invalid link: HomePage


Error: Uncaught (in promise): invalid link: HomePage 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:45465:16) at NavControllerBase._failed (http://localhost:8100/build/main.js:45453:14) at http://localhost:8100/build/main.js:45508:59 at t.invoke (http://localhost:8100/build/polyfills.js:3:11562) at Object.onInvoke (http://localhost:8100/build/main.js:4622: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:4613:37) at t.invokeTask (http://localhost:8100/build/polyfills.js:3:12177) at n.runTask (http://localhost:8100/build/polyfills.js:3:7153)

@edit: The problem occurs when I want login to my app. It's code respondent to login.

login.ts

public login() {
    this.showLoading()
    this.auth.login(this.registerCredentials).subscribe(allowed => {
      if (allowed) {        
       this.nav.push('HomePage');
      } else {
        this.showError("Access Denied");
      }
    },
      error => {
        this.showError(error);
      });
    }

auth-service.ts ( here is public function which execute my loin and where i have pass and email which I need to type in login )

  public login(credentials) {
    if (credentials.email === null || credentials.password === null) {
      return Observable.throw("Please insert credentials");
    } else {
      return Observable.create(observer => {
        // At this point make a request to your backend to make a real check!
        let access = (credentials.password === "pass" && credentials.email === "email");
        this.currentUser = new User('Simon', 'saimon@devdactic.com');
        observer.next(access);
        observer.complete();
      });
    }
  }

I don't know why this code is wrong. My home page iny my app is home.ts and class is HomePage

what you need to do is to add @IonicPage() before '@Component' and import 'IonicPage' like this : import {NavController, IonicPage} from 'ionic-angular';

then you need to create a module for the homepage i.e in the home directory , create home.module.ts with the following contents

import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { HomePage } from './home';

@NgModule({
  declarations: [
    HomePage
  ],
  imports: [
    IonicPageModule.forChild(HomePage),
  ],
  exports: [
    HomePage
  ]
})
export class HomePageModule {}

and reload the project

Ionic Uncaught (in promise): invalid link, what you need to do is to add @IonicPage() before '@Component' and import '​IonicPage' like this : import {NavController, IonicPage} from  as seen here the declared class is before the declaration of page class that's why it was saying invalid error, but after remiving the logininfo class the link was working Sign up for free to join this conversation on GitHub .

The only problem in your code is when you write this.nav.push('HomePage'); remove the ' ' quotes when calling any page, and write like this.

this.nav.push(HomePage); without quotes.

Above answer is for ionic2, in ionic3 there is lazy loading where you call like this this.nav.push('HomePage');

annoying issue : Uncaught (in promise): invalid link: TabsPage , every time it shows the error Uncaught (in promise): invalid link: TabsPage, i have to stop serve and rerun ionic serve, this is really annoying  Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question.Provide details and share your research! But avoid …. Asking for help, clarification, or responding to other answers.

I copied login example. The error is similar.

Check points for HomePage : (1) check whether home.module.ts is (2) check @IonicPage() before '@Component' in home.ts (2) remove HomePage from declaration/entryComponents in app.module.ts when facing open-error

Ionic 3 lazy loading, Hi, I try to use ionic3 lazyloading feature. But I'm getting following error: Uncaught (in promise): Error: Cannot find module '. For the next major release of Ionic, we plan on relying more heavily on whatever router is used by the Framework (Angular in this case). That may resolve this issue. Since all current work is focused on getting the next major release ready for release, I will mark this as something to look at again at that time.

Just add @IonicPage() before @component in ts file for example:

@IonicPage() @Component({ selector: 'page-wall', templateUrl: 'wall.html', })

Ionic 3: Template Changes (invalid link), Uncaught (in promise): invalid link: MyPage. This error appears when you try to navigate to a page that's not existing. Perhaps you spelled the  I am studying the Lazy load in Ionic 3 too. Today I had an issue with it. This video explains how to use it Ionic 3 - Lazy Loading Modules/Routes. I do not need to use @IonicPage({name: 'name-of-my-page'}), just follow the steps in the video and work perfectly to me.

Turn out It work like a charm once you restart the server again, Took me hours to fix,If issue is not resolved by @IonicPage(), just restart your server. ie ionic serve. Happy coding!!!

10 Common Ionic Problems & Error Messages (And How to Fix , Error: Uncaught (in promise): invalid link: LoginPage in case of lazy loading unit test My Ionic 3 application is lazy loaded with a LoginPage as rootPage and I  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.

Error: Uncaught (in promise): invalid link: LoginPage in case of lazy , Ionic Uncaught (in promise): invalid link. Question. i have propably problem with this.nav.push in Ionic. I have done a login/registration page but when i login i  We use Github to track problems with the code itself, so I kindly ask that you ask your question on our Ionic forum. Members of the community and Ionic staff hang out there to help one another. Members of the community and Ionic staff hang out there to help one another.

Ionic Uncaught (in promise): invalid link, This is a ionic project using ionic-cli@3.0.0-rc.0 and ionic-angular@3.1.1, so please be sure to use the right ionic cli. This repo is using a two "layer" navigation, in the AppComponent is the first ion-nav which is handling loading LoginPage or MainPage where is the second ion-nav which is handling all other pages.

angular: ERROR Error: Uncaught (in promise): invalid link: LoginPage, The property of your object is not the problem but the object itself; you are trying to access a property of an element that’s undefined (or in other cases null).. Check where you initialise your object or use the elvis operator to access properties safely without breaking your apps code:

Comments
  • Welcome to StackOverflow! In order for us to help you better, please update your question so that it shows all relevant code in a minimal, complete, and verifiable example. It would also be helpful if you could let us know what you have tried so far to solve your problem. For further information, please refer to the help article regarding how to ask good questions, and take the tour of the site :)
  • In ionic guide page there is no quotes. ionicframework.com/docs/api/navigation/NavController
  • its a lazy loading thing read here blog.ionicframework.com/ionic-and-lazy-loading-pt-1