代码之家  ›  专栏  ›  技术社区  ›  AbhiRam

typeerror:array.prototype.map:参数不是WebPackAsyncContext中的函数对象

  •  0
  • AbhiRam  · 技术社区  · 6 年前

    我是Ionic开发的初学者,我正在尝试使用下面的代码将登录页移动到注册页,但是当我执行操作时,我发现了下面的错误,我试图从两天开始解决这个问题,但它不起作用,我在下面粘贴了我的全部代码细节,可以在E上帮助我请问我哪里做错了,我该怎么解决?

    错误:

    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
    

    应用模块.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

     registerClick() {
        this.nav.push('RegisterPage');
      }
    
    0 回复  |  直到 6 年前