TypeError:Array.prototype.map:参数不是webpackAsyncContext的Function对象

时间:2018-12-04 06:38:18

标签: ionic-framework

我是Ionic开发的初学者,我正尝试使用以下代码将登录页面移至注册页面,但是当我执行操作时,我遇到了以下错误,并且自两天以来我一直试图解决此问题,但是它无法正常工作,我在下面粘贴了我的代码的全部详细信息,可以帮助我些什么,我在哪里做错了,我该如何解决?

错误:

Error: Uncaught (in promise): TypeError: undefined is not a function
TypeError: undefined is not a function
    at Array.map (<anonymous>)
    at webpackAsyncContext (http://localhost:8100/build/main.js:134:34)
    at loadAndCompile (http://localhost:8100/build/vendor.js:71269:36)
    at NgModuleLoader.load (http://localhost:8100/build/vendor.js:71253:83)
    at ModuleLoader.load (http://localhost:8100/build/vendor.js:58947:44)
    at DeepLinker.getNavLinkComponent (http://localhost:8100/build/vendor.js:25633:39)
    at DeepLinker.getComponentFromName (http://localhost:8100/build/vendor.js:25620:25)
    at getComponent (http://localhost:8100/build/vendor.js:36151:23)
    at convertToView (http://localhost:8100/build/vendor.js:36165:16)
    at convertToViews (http://localhost:8100/build/vendor.js:36179:32)
    at c (http://localhost:8100/build/polyfills.js:3:19752)
    at Object.reject (http://localhost:8100/build/polyfills.js:3:19174)
    at NavControllerBase._fireError (http://localhost:8100/build/vendor.js:52389:16)
    at NavControllerBase._failed (http://localhost:8100/build/vendor.js:52382:14)
    at http://localhost:8100/build/vendor.js:52429:59
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14976)
    at Object.onInvoke (http://localhost:8100/build/vendor.js:5085:33)
    at t.invoke (http://localhost:8100/build/polyfills.js:3:14916)
    at r.run (http://localhost:8100/build/polyfills.js:3:10143)
    at http://localhost:8100/build/polyfills.js:3:20242

app.module.ts

@NgModule({
  declarations: [
    MyApp
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    RegisterPageModule,
    LoginPageModule,
    HomePageModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot(),
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage,
    LoginPage,
    RegisterPage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    AuthService,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

packages.json

{
  "name": "examination",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint"
  },
  "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/cli": "^7.1.1",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/core": "~4.17.0",
    "@ionic-native/splash-screen": "~4.17.0",
    "@ionic-native/status-bar": "~4.17.0",
    "@ionic/lab": "^1.0.15",
    "@ionic/storage": "2.2.0",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.1",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project"
}

login.ts

 registerClick() {
    this.nav.push('RegisterPage');
  }

0 个答案:

没有答案