首页 > 技术文章 > Unit Test(一)(Error: is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. )

rushintocloud 2021-07-30 14:41 原文

1.  Error: F:\workspace\vmcu-estimator-client\src\environments\environment.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. 

表现分析: log 报错的意思是environment.ts未被Ts的编译器编译,造成在用的时候缺失

Solution:经查阅 tsconfig 相关配置,定位到只需要在tsconfig.spec.ts里include 属性加上environment.ts文件即可

 

2.Error: No value accessor for form control with name: 'selection'

 

表现分析:log中报错的意思没有selection这个form值的访问器,

Solution:其实是缺少form module的问题,参考了许多解决方案不过都没有成功,最后把app.moudule的import复制一边,解决done.

 

推荐阅读