错误:无法确定组件页面的模块



一切都很好,今天我想用" Ionic Build iOS"构建 - 我过去很长时间构建了这个应用程序 - 但是现在我得到了

错误:无法确定组件游戏page的模块!

我该如何修复/调试?

这是我的app.module.ts

import {NgModule, ErrorHandler} from '@angular/core';
import {IonicApp, IonicModule, IonicErrorHandler} from 'ionic-angular';
import {MyApp} from './app.component';
import {AboutPage} from '../pages/about/about';
import {ContactPage} from '../pages/contact/contact';
import {HomePage} from '../pages/home/home';
import {TabsPage} from '../pages/tabs/tabs';
import {LoginPage} from "../pages/login/login";
import {GamePage} from "../pages/game/game";
import {ShopPage} from "../pages/shop/shop";
import {RegisterPage} from "../pages/register/register";

@NgModule({
    declarations: [
        MyApp,
        AboutPage,
        ContactPage,
        HomePage,
        TabsPage,
        LoginPage,
        GamePage,
        ShopPage,
        RegisterPage
    ],
    imports: [
        IonicModule.forRoot(MyApp)
    ],
    bootstrap: [IonicApp],
    entryComponents: [
        MyApp,
        AboutPage,
        ContactPage,
        HomePage,
        TabsPage,
        LoginPage,
        GamePage,
        ShopPage,
        RegisterPage
    ],
    providers: [
        {provide: ErrorHandler, useClass: IonicErrorHandler}
    ]
})
export class AppModule {
}

这是我的tsconfig.json:

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5"
  },
  "include": [
    "src/app/*.ts",
    "src/pages/*.ts",
    "www/assets/app/**/*.ts"
    //"www/assets/app/**/**/*.ts"
  ],
  "exclude": [
    "node_modules"/*,
    "www/assets/app/modules/exlude"*/
  ],
  "compileOnSave": true,
  "atom": {
    "rewriteTsconfig": false
  }
}

和我的游戏。ts

import {Component} from '@angular/core';
import {NavController, MenuController, IonicApp} from 'ionic-angular';
import * as $ from 'jquery';
import {Lavoisier_ionic} from "../../../www/assets/app/Lavoisier_ionic";
import {MenuGame} from "../../../www/assets/app/modules/mod_menu_game/mod_menu_game";
import {Background} from "../../../www/assets/app/modules/mod_background/mod_background";
import {DataGuardian} from "../../../www/assets/app/modules/mod_data_guardian/mod_data_guardian";
import {Auth} from "../../../www/assets/app/modules/mod_auth/mod_auth";
import {User} from "../../../www/assets/app/modules/mod_user/mod_user";
import {StartGame} from "../../../www/assets/app/modules/mod_start_game/mod_start_game";
import {MenuInGame} from "../../../www/assets/app/modules/mod_menu_ingame/mod_menu_ingame";
import {Body} from "../../../www/assets/app/modules/mod_body/mod_body";
import {MenuCasClinique} from "../../../www/assets/app/modules/mod_menu_cas_clinique/mod_menu_cas_clinique";
import {DossierPatient} from "../../../www/assets/app/modules/mod_dossier_patient/mod_dossier_patient";
import {Hypothese} from "../../../www/assets/app/modules/mod_hypothese/mod_hypothese";
import {InterrogatoirePlayground} from "../../../www/assets/app/modules/mod_interrogatoire_playground/mod_interrogatoire_playground";
import {Interrogatoire} from "../../../www/assets/app/modules/mod_interrogatoire/mod_interrogatoire";
import {ExamenPhysique} from "../../../www/assets/app/modules/mod_examen_physique/mod_examen_physique";
import {ConstantesVitales} from "../../../www/assets/app/modules/mod_constantes_vitales/mod_constantes_vitales";
import {Scoring} from "../../../www/assets/app/modules/mod_scoring/mod_scoring";
import {Bilan} from "../../../www/assets/app/modules/mod_bilan/mod_bilan";
import {Countdown} from "../../../www/assets/app/modules/mod_countdown/mod_countdown";
import {Correct} from "../../../www/assets/app/modules/mod_correct/mod_correct";
import {Diagnostic} from "../../../www/assets/app/modules/mod_diagnostic/mod_diagnostic";
import {ActionsDangereuses} from "../../../www/assets/app/modules/mod_actions_dangereuses/mod_actions_dangereuses";
import {EndGame} from "../../../www/assets/app/modules/mod_end_game/mod_end_game";
import {Exploration} from "../../../www/assets/app/modules/mod_exploration/mod_exploration";
import {ExplorationPlayground} from "../../../www/assets/app/modules/mod_exploration_playground/mod_exploration_playground";
import {Http} from "@angular/http";
import {Fondamental} from "../../../www/assets/app/modules/mod_fondamental/mod_fondamental";
import {Help} from "../../../www/assets/app/modules/mod_help/mod_help";
import {MesuresUrgencesPlayground} from "../../../www/assets/app/modules/mod_mesures_urgences_playground/mod_mesures_urgences_playground";
import {MesuresUrgences} from "../../../www/assets/app/modules/mod_mesures_urgences/mod_mesures_urgences";
import {LowTime} from "../../../www/assets/app/modules/mod_low_time/mod_low_time";
import {NotePad} from "../../../www/assets/app/modules/mod_notepad/mod_notepad";
import {OpenNotePad} from "../../../www/assets/app/modules/mod_button_open_notepad/mod_button_open_notepad";
import {SaveDB} from "../../../www/assets/app/modules/mod_savedb/mod_savedb";
import {Modal} from "../../../www/assets/app/modules/mod_modal/mod_modal";
import {Storage} from '@ionic/storage';
/*
 Generated class for the Game page.
 See http://ionicframework.com/docs/v2/components/#navigation for more info on
 Ionic pages and navigation.
 */
@Component({
    selector: 'page-game',
    templateUrl: 'game.html',
    providers: [Storage]
})
export class GamePage {
    lavoisier_ionic: any;
    constructor(public navCtrl: NavController, storage: Storage, public http: Http, public menuCtrl: MenuController,app:IonicApp) {
        var that = this;
        var publickey;
        $(document).ready(function () {
            storage.get('publickey').then((val) => {
                publickey = val;
                that.lavoisier_ionic = new Lavoisier_ionic(http,app,navCtrl);
                that.lavoisier_ionic.addModule(new DataGuardian(that.lavoisier_ionic, http, publickey));
                that.lavoisier_ionic.addModule(new Auth(that.lavoisier_ionic, http, publickey));
                that.lavoisier_ionic.addModule(new User(that.lavoisier_ionic, http));
                that.lavoisier_ionic.addModule(new Background(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new MenuGame(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new StartGame(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Body(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new MenuCasClinique(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new MenuInGame(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new DossierPatient(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Hypothese(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new InterrogatoirePlayground(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Interrogatoire(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new ExamenPhysique(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new ConstantesVitales(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Scoring(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Bilan(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Countdown(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Correct(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Diagnostic(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new ActionsDangereuses(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new EndGame(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Exploration(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new ExplorationPlayground(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Fondamental(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Help(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new MesuresUrgencesPlayground(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new MesuresUrgences(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new LowTime(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new NotePad(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new OpenNotePad(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new Modal(that.lavoisier_ionic));
                that.lavoisier_ionic.addModule(new SaveDB(that.lavoisier_ionic));
                that.lavoisier_ionic.init();
                that.lavoisier_ionic.render();
            });
        });

    }

}

我找到了问题!!!我在非角度模块中导入一个角分量。正如错误所说:无法确定组件游戏页面的模块!

在我的情况下,我有三个类同名的类(由团队成员添加(,仅导入一个。我必须更改名称并在AppModule中的导入保留。然后解决了问题。

我相信,每当我们添加任何组件,指令,管道我们使用是否使用时,我们都必须添加到导入中,否则会出现此错误。

相关内容

  • 没有找到相关文章

最新更新