简体   繁体   中英

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. It also works when I do 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.

angular.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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM