Ionic 3:部署打字稿错误

时间:2017-12-06 13:45:21

标签: angular typescript ionic-framework ionic3

我完成了我正在处理的应用程序并且它在离子服务上工作没有任何问题,但是在编译时我遇到了这个,任何帮助都非常感谢。

[15:40:08]  typescript error 
            Type ResultPage in C:/Users/Omar/Desktop/InfoKing/src/pages/result/result.ts is part of the declarations of
            2 modules: AppModule in C:/Users/Omar/Desktop/InfoKing/src/app/app.module.ts and ResultPageModule in
            C:/Users/Omar/Desktop/InfoKing/src/pages/result/result.module.ts! Please consider moving ResultPage in
            C:/Users/Omar/Desktop/InfoKing/src/pages/result/result.ts to a higher module that imports AppModule in
            C:/Users/Omar/Desktop/InfoKing/src/app/app.module.ts and ResultPageModule in
            C:/Users/Omar/Desktop/InfoKing/src/pages/result/result.module.ts. You can also create a new NgModule that
            exports and includes ResultPage in C:/Users/Omar/Desktop/InfoKing/src/pages/result/result.ts then import
            that NgModule in AppModule in C:/Users/Omar/Desktop/InfoKing/src/app/app.module.ts and ResultPageModule in
            C:/Users/Omar/Desktop/InfoKing/src/pages/result/result.module.ts.
            
            

Error: The Angular AoT build failed. See the issues above
    at C:\Users\Omar\Desktop\InfoKing\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:237:55
    at step (C:\Users\Omar\Desktop\InfoKing\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:32:23)
    at Object.next (C:\Users\Omar\Desktop\InfoKing\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:13:53)
    at fulfilled (C:\Users\Omar\Desktop\InfoKing\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:4:58)
    at <anonymous>

1 个答案:

答案 0 :(得分:1)

result.module.ts文件中删除@IonicPage并删除result.ts,然后重新运行 希望它适合你