【问题标题】:How to resolve: Cannot determine the module for class OverlayPortal如何解决:无法确定类 OverlayPortal 的模块
【发布时间】:2020-11-26 19:36:31
【问题描述】:

我面临以下问题:如果我尝试使用 --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,则不会出现错误。我没有使用代码中错误消息中提到的任何类。

【问题讨论】:

    标签: ionic-framework ionic3


    【解决方案1】:

    我通过搜索我的代码并删除对 Ionics Page 类的任何引用解决了这个问题,建议 here

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

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

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

    【讨论】:

      猜你喜欢
      • 2018-03-17
      • 2017-12-19
      • 1970-01-01
      • 1970-01-01
      • 2021-08-31
      • 2021-07-12
      • 2019-05-20
      • 1970-01-01
      • 2014-09-01
      相关资源
      最近更新 更多