angular - 此类通过 SomeModule -> SomeComponent 对消费者可见,但不会从顶级库入口点导出
问题描述
我将我所有的角度库都升级为angular 9.0.0
使用ng update
,当我尝试构建它们时,我得到了以下错误。
错误:
不支持的私有类 SomeComponent。此类通过 SomeModule -> SomeComponent 对消费者可见,但不会从顶级库入口点导出。
有人解决了这个错误吗?
解决方案
如果任何组件被导出NgModule
但未包含在您的 中public_api.ts
,则会发生此错误,Angular 9
现在将引发错误。
这个错误没有出现,Angular 8
但在升级到Angular 9
它之后开始显示。
如果您导出了任何service
,module
或component
, 等,请NgModule
确保将它们包括在内,public_api.ts
否则angular 9
现在会抛出错误。
修复:将您的组件添加到public_api.ts
export * from './lib/components/some-me/some-me.component';
推荐阅读
- java - 使用 Enum 的 Spring 请求 notempty 验证
- android - 如何从字符串变量中的 Firebase 数据库访问此嵌套值?
- javascript - 在 webpack 中操作(第一个)块的名称?
- python - 如何在 python 中使用 request.post() 方法处理异常
- c# - C# - 将 Int 转换为 Hex 4 字节
- c++ - 如何从 C++ 中的张量流变量中获取数据
- ruby-on-rails - Rails6.0.0 + Faker +Devise + Seed
- neo4j - 项目启动时如何让 Spring Data Neo4j 忽略连接检查?
- sql - 当列小于0时如何计算SQL中的总时间
- wordpress - 如何仅针对移动设备禁用来自 wordpress 网站的一个信号推送通知