title: ERROR Error: Uncaught (in promise): TypeError: undefined is not a function
body: <p>I am trying to implement Lazyloading with ionic project but I am getting error while Implementing , I am putting the error BELOW that I am getting while implementing lazyloading </p>
  
  <blockquote>
    <p>core.js:1449 ERROR Error: Uncaught (in promise): TypeError: undefined
    is not a function TypeError: undefined is not a function</p>
  </blockquote>
  
  <p>I am putting code below </p>
  
  <p>app.module.ts </p>
  
  <pre><code>import { NextPageModule } from '../pages/next/next.module';
  import { HomePageModule } from './../pages/home/home.module';
  import { BrowserModule } from '@angular/platform-browser';
  import { ErrorHandler, NgModule } from '@angular/core';
  import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
  import { SplashScreen } from '@ionic-native/splash-screen';
  import { StatusBar } from '@ionic-native/status-bar';
  
  import { MyApp } from './app.component';
  
  @NgModule({
    declarations: [
      MyApp,
    ],
    imports: [
      HomePageModule,
      NextPageModule,
      BrowserModule,
      IonicModule.forRoot(MyApp),
    ],
    bootstrap: [IonicApp],
    entryComponents: [
      MyApp,
    ],
    providers: [
      StatusBar,
      SplashScreen,
      {provide: ErrorHandler, useClass: IonicErrorHandler}
    ]
  })
  export class AppModule {}
  </code></pre>
  
  <p>app.component.ts</p>
  
  <pre><code>import { Component } from '@angular/core';
  import { Platform } from 'ionic-angular';
  import { StatusBar } from '@ionic-native/status-bar';
  import { SplashScreen } from '@ionic-native/splash-screen';
  
  // import { HomePage } from '../pages/home/home';
  @Component({
    templateUrl: 'app.html'
  })
  export class MyApp {
    rootPage:string = 'NextPage';
  
    constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
      platform.ready().then(() =&gt; {
        // Okay, so the platform is ready and our plugins are available.
        // Here you can do any higher level native things you might need.
        statusBar.styleDefault();
        splashScreen.hide();
      });
    }
  }
  </code></pre>