错误:无法在--prod中确定OverlayPortal类的模块 [英] Error: Cannot determine the module for class OverlayPortal in --prod

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

问题描述

我不确定我是否只遇到一个问题只有离子cordova运行android --prod 和我的离子cordova运行android 工作正常。

i am not sure i am facing an issue only with ionic cordova run android --prod and my ionic cordova run android works fine.

错误:

Error: Cannot determine the module for class OverlayPortal in /Users/gopi/Documents/bos/hybrid-app/node_modules/ionic-angular/es2015/components/app/overlay-portal.d.ts! Add OverlayPortal to the NgModule to fix it.
Cannot determine the module for class IonicApp in /Users/gopi/Documents/bos/hybrid-app/node_modules/ionic-angular/es2015/components/app/app-root.d.ts! Add IonicApp to the NgModule to fix it.
Cannot determine the module for class ClickBlock in /Users/gopi/Documents/bos/hybrid-app/node_modules/ionic-angular/es2015/components/app/click-block.d.ts! Add ClickBlock to the NgModule to fix it.
Cannot determine the module for class Slides in /Users/gopi/Documents/bos/hybrid-app/node_modules/ionic-angular/es2015/components/slides/slides.d.ts! Add Slides to the NgModule to fix it.

有人可以给我清楚的解释:

Can some one give me clear explaination:

这是我的离子信息

cli包:(/ usr / local / lib / node_modules)

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

全球套餐:

Cordova CLI : 7.0.1

本地包裹:

@ionic/app-scripts : 1.3.8
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.4.2

系统:

Android SDK Tools : 25.2.5
Node              : v6.11.1
npm               : 3.10.10
OS                : macOS Sierra
Xcode             : Xcode 8.3.2 Build version 8E2002


推荐答案

我终于找到了解决方法。我从 ionic-angular 中导入了一些直接导入嵌套组件的导入,而不是从顶级包导出导入。我猜测产品AOT编译器不喜欢从顶层导入一些导入,而是直接导入嵌套项目。我的一个例子如下。我的猜测是你可以选择这些方法中的任何一种,但是当混合它们时,AOT编译器将不会满意。

I finally found a fix for this. I had a few imports from ionic-angular that imported the nested component directly as opposed to importing from the top-level package export. I'm guessing the prod AOT compiler didn't like having some imports from the top-level and some directly to the nested item. An example for me is below. My guess is you could choose either one of these approaches, but when mixing them the AOT compiler won't be happy.

从'ionic-angular'导入{LoadingController};

错误

从'ionic-angular / components / loading / loading-controller'导入{LoadingController};

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

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