如何解决:无法确定类OverlayPortal的模块 [英] How to resolve: Cannot determine the module for class OverlayPortal

查看:196
本文介绍了如何解决:无法确定类OverlayPortal的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

使用的构建命令:

ionic cordova build ios --prod

如果我在没有--prod标志的情况下进行构建或使用ionic serve,则不会出现该错误.我没有在代码中使用错误消息中提到的任何类.

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.

推荐答案

我通过搜索代码并删除对Ionics Page类的任何引用来解决此问题,建议使用

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

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

还请确保删除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';

这篇关于如何解决:无法确定类OverlayPortal的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆