[英]Encountered undefined provider! Usually this means you have cies. This might be caused by using 'barrel' index.ts files
this is the error which i get in production build 这是我在生产版本中遇到的错误
by using Layout Module.ts file as child where all the inner pages are included and ,app module.ts as parent including only the app component.ts file ,whenever I use (ng build --prod) 每当我使用(ng build --prod)时,通过将Layout Module.ts文件用作包含所有内部页面的子级文件,将appmodule.ts作为仅包含app component.ts文件的父级文件
it show : /error message as/ 它显示:/错误消息为/
circular dependencies (might be caused by using 'barrel' index.ts files. 循环依赖关系(可能是由于使用“ barrel” index.ts文件引起的。
I know it's hard to post the whole project because this issue more or less relates to the circular dependencies injection. 我知道很难发布整个项目,因为这个问题或多或少与循环依赖注入有关。 This usually happens like, for example, you have 3 files
a.ts
, b.ts
, c.ts
and a import b, b import c and c import a
. 这通常发生,例如,您有3个文件
a.ts
, b.ts
, c.ts
和a import b, b import c and c import a
。 Or even more. 甚至更多。
So my suggestion to debug this case is to check if your ts files to find out the circular loop. 所以我建议调试这种情况是检查您的ts文件是否找出循环。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.