Lazy load pages random error:ERROR Error: Uncaught (in promise): invalid link:

I run into the following error every now and then.

ERROR Error: Uncaught (in promise): invalid link:MenuPage
    at d (polyfills.js:3)
    at l (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:4125)
    at t.invoke (polyfills.js:3)
    at n.run (polyfills.js:3)
    at polyfills.js:3
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (core.es5.js:4116)
    at t.invokeTask (polyfills.js:3)
    at n.runTask (polyfills.js:3)

I'm not aware of any steps to reproduce and this error is not causing any problem at all The app is working normally and the Menu Page is displayed correctly.

import { Component, ViewChild } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Nav, Platform } from 'ionic-angular';

@IonicPage({
  name: "menu",
  segment: "app"
}
)
@Component({
  selector: 'page-menu',
  templateUrl: 'menu.html'
})
export class MenuPage {}

I had checked my project and the menu page is only used by its IonicPage name "menu".

There is already an ionic forum post but I am already following the proposed accepted solution which is about giving a name to the IonicPage annotation.


Same thing happens to me sometimes. Likewise I was not able to determine where the error comes from, as it happens only rarely. Looks like a bug with the app scripts, as stopping and starting "ionic serve" seems to solve the issue.

Cannot get deep links to work "Uncaught (in promise): invalid link , ERROR Error: Uncaught (in promise): invalid link: MainPage at c I basically ended up enabling lazy loading, as I followed every advice or Lazy load pages random error:ERROR Error: Uncaught (in promise): invalid link:  Lazy load pages random error:ERROR Error: Uncaught(in promise): invalid link: (8) According to your error, it looks like you are trying to use the class name MenuPage as a deep link. this.navCtrl.push('MenuPage');


According to your error, it looks like you are trying to use the class name MenuPage as a deep link. this.navCtrl.push('MenuPage');

ERROR Error: Uncaught (in promise): invalid link:MenuPage

In your case, you declared the deep link as "menu". So you should use:

this.navCtrl.push('menu');

Or if you want, keep using the class, but without quotes: this.navCtrl.push(MenuPage);

Invalid views to insert using lazy loading with last nightly · Issue , Hello, same problem here. When I try to reach an inner page which is lazy loaded I often get: Runtime Error Uncaught (in promise): invalid views  16 Lazy load pages random error:ERROR Error: Uncaught (in promise): invalid link: May 19 '17 11 Android BLE device scan with filter is not working Dec 4 '15 8 Angular 7 PWA configure Push Notifications Dec 13 '18


Restart your server and you will be fine.

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 '. 9 Lazy load pages random error:ERROR Error: Uncaught (in promise): invalid link: 9 Lottie Android: add color overlay to animation 6 Laravel 5.2 Unit Tests error: BadMethodCallException: Call to undefined method Illuminate\Database\Query\Builder::make()


I don't see you mentioning anything about a menu.module.ts file. To configure lazy loading you need a module file per page/component.

This file is required so Ionic can understand which components need to be loaded when your page is initialized. Here's an example of a module file for a page:

import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { MenuPage } from './menu.page';
import { SomeComponentModule } from '../../components/some/some.component.module';

@NgModule({
    declarations: [
        MenuPage
    ],
    imports: [
        IonicPageModule.forChild(MenuPage),
        HeaderComponentModule
    ],
    exports: [
        MenuPage
    ]
})
export class MenuPageModule { }

The component in this file is just an example. So if you have a component called SomeComponent in your project. Then you should import it in your page.module, only if you're using that component in your page of course.

The SomeComponent also has a module file which exports the SomeComponent as SomeComponentModule which can be imported in the page.module file.

Adding IonicPageModule.forChild(MenuPage) to the imports is required as well.

Finally, if you created a module file per component/page then you can remove all component/page imports from your app.module.ts file.

The rest you've mentioned is configured correctly. The IonicPage() annotation is still required per page and you should be able to navigate use this.navCtrl.push('menu') since you've set the name to 'menu'.

NOTE: please make sure the filename of your module file has the same name as the name of the page filename but with .module appended to it. For example a menu.ts page file should have a corresponding menu.module.ts file.

ERROR Error: Uncaught (in promise): invalid link: SosPopPage , I am coding a SOS page, when I click the button that I want it showing a popup page like this. ERROR Error: Uncaught (in promise): invalid link: SosPopPage If you are not using lazy loading, it is not an IonicPage . Adding Not able to display random images below product image in Ruby on rails app? 19 Lazy load pages random error:ERROR Error: Uncaught (in promise): invalid link: 10 Ionic 3, shared module for pipes, for lazy loaded pages 8 How to use angular 6 in ionic 3?


If you didn't restart your server after adding your new page(in this case MenuPage) stop and restart ionic serve. Error will be solve.

Uncaught In Promise Ionic 3, ERROR Error: Uncaught (in promise): Error: No provider for Device! Lazy load pages random error:ERROR Error: Uncaught(in promise): invalid link: (8). Copy link Quote reply ionic (Ionic CLI) : 3.8.1. global packages: Cordova CLI If you  « first day (249 days earlier) ← previous day next day → last day (1018 days later) »


User SolveSoul, compileKotlin block in build.gradle file throws error “Could not find method Lazy load pages random error:ERROR Error: Uncaught (in promise): invalid link:. 5 Lazy load pages random error:ERROR Error: Uncaught (in promise): invalid link: 5 File size is 0 only for videos in Ionic on iOS 13.2 when selecting videos from Photo Library 5 Ionic 3 Post to REST API (Swagger)


User Sudarshana Dayananda, 5 Lazy load pages random error:ERROR Error: Uncaught (in promise): invalid link: · 5 Ionic 3 Post to REST API (Swagger) · 5 File not uploading in server ionic3. Q&A for peer programmer code reviews. Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.


Search console - JavaScript error, This error only shows search console as a mention. and as our page is dynamic is hard to find which have this error. ERROR Error: Uncaught (in promise):. ChunkLoadError: Loading chunk 19 failed. As you can see is a large site, have more 300 components, and we use lazy loading, Link to post. error: insert into "register" values returning * - invalid input syntax for type time: "" error: invalid initializer; Error: Job name "..getProjectMetadata" does not exist. error: key does not contain section; Error: listen EADDRINUSE: address already in use :::31641; Error: Missing credentials for "PLAIN"