1

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"
                }
              ]
            }
dash
  • 387
  • 1
  • 11
  • try to add "apiUrl" property in environment.staging.ts file. Also please check if you miss any config for the tests – Anto Antony Jan 13 '20 at 09:36
  • the apiUrl was fixed, it was my error. I updated the post. Thanks. – dash Jan 13 '20 at 09:40
  • The issue is with your CandidateViewComponent. Try to find out the issue in it. Might be it's related to the packages you have imported in that file or otherwise something to do with your code. – Surjeet Bhadauriya Jan 13 '20 at 09:53
  • I thought so too, but when I deactivate the code there it just show the same error in a different component. I really suspect it has something to do with the difference in the compiler between angular 5 and up Because it runs smoothly in angular 5. – dash Jan 13 '20 at 10:05

1 Answers1

1

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 "\u200F\u200F"

I deleted it and it works.

Thanks for all the helpers!

dash
  • 387
  • 1
  • 11