解决方法:无法确定类覆盖门户的模块



我面临以下问题:如果我尝试使用--prod标志为 ios 构建我的 Ionic 3 应用程序,则会出现以下错误:

typescript error
Cannot determine the module for class OverlayPortal in
C:/.../node_modules/ionic-angular/umd/components/app/overlay-portal.d.ts!
Add OverlayPortal to the NgModule to fix it. Cannot determine the module for class IonicApp in
C:/.../node_modules/ionic-angular/umd/components/app/app-root.d.ts! 
Add IonicApp to the NgModule to fix it. Cannot determine the module for class ClickBlock in
C:/.../node_modules/ionic-angular/umd/components/app/click-block.d.ts! 
Add ClickBlock to the NgModule to fix it.

使用的构建命令:

ionic cordova build ios --prod

如果我在没有--prod标志的情况下构建或如果我使用ionic serve.我没有在代码中使用错误消息中提到的任何类。

我通过搜索我的代码并删除对 IonicsPage类的任何引用来解决这个问题,这是在这里建议的。

示例:将let page : Page;转换为let page;

还要确保删除Page类的任何导入,它可能如下所示:

import { Page } from 'ionic-angular/umd/navigation/nav-util';

最新更新