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

如何解决:无法确定类OverlayPortal的模块

  •  0
  • Phonolog  · 技术社区  · 7 年前

    我面临以下问题:如果我尝试用 --prod 标志,我得到以下错误:

    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
    

    如果不使用 --产品 旗帜或者如果我使用 ionic serve . 我的代码中没有使用错误消息中提到的任何类。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Phonolog    6 年前

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

    示例:Turn let page : Page; let page;

    还要确保删除 第页

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