[英]Can't resolve all parameters (AOT, buildOptimizer) on Staging & Prod (ng serve works)
I just upgraded from 5 to 8. It works (and really fast) when ng-serve.我刚刚从 5 升级到 8。它在 ng-serve 时工作(而且非常快)。 It also works when I do ng-build.
当我执行 ng-build 时它也有效。 But when I tell it to build on
但是当我告诉它建立在
ng build --configuration=staging
I get我得到
ERROR in Can't resolve all parameters for CandidateViewComponent ([object Object], [object Object])
But if I change "aot" & "buildOptimizer" to false (in angular.json) it does build successfully.但是,如果我将“aot”和“buildOptimizer”更改为 false(在 angular.json 中),它确实会成功构建。
angular.json:角度.json:
"staging": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.staging.ts"
}
]
}
Whoever is reading this, I found the problem.谁在读这个,我发现了问题。 Turns out that from some reason was an added character to the import path:
事实证明,由于某种原因,导入路径中添加了一个字符:
import { SelectedCompanyService } from 'app/shared/_services/\u200F\u200Fselected-company.service';
the "\\" “\\”
I deleted it and it works.我删除了它,它可以工作。
Thanks for all the helpers!感谢所有的帮助者!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.