How to resolve: Cannot determine the module for class OverlayPortal

*爱你&永不变心* 提交于 2019-12-24 10:47:04

问题


I'm facing following issue: If I try to build my Ionic 3 app for ios with the --prod flag, I get following error:

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.

Build command used:

ionic cordova build ios --prod

The error does not appear if I build without the --prod flag or if I use ionic serve. I'm not using any of the classes mentioned in the error message in my code.


回答1:


I resolved the issue by searching through my code and removing any reference to Ionics Page class, which is suggested here.

Example: Turn let page : Page; into let page;

Also make sure to remove any imports of the Page class, which might look like this:

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


来源:https://stackoverflow.com/questions/51982973/how-to-resolve-cannot-determine-the-module-for-class-overlayportal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!