Angular 9 universal Error: Component 'HeaderComponent' is not resolved: Angular 9 universal Error: Component 'HeaderComponent' is not resolved: express express

Angular 9 universal Error: Component 'HeaderComponent' is not resolved:


After 2 days of fixing this I got an answer.Part of angular.json with pror architect must be next:

"architect": {        "build": {          "builder": "@angular-devkit/build-angular:browser",          "options": {            "outputPath": "dist/test-ssr/browser",            "index": "src/index.html",            "main": "src/main.ts",            "polyfills": "src/polyfills.ts",            "tsConfig": "src/tsconfig.app.json",            "aot": true,

In my case builder was wrong "builder": "@angular-devkit/custom-webpack:browser",and also I was using customWebpackConfig

"options": {            "customWebpackConfig": {              "path": "./config/custom.webpack.config.js",              "mergeStrategies": { "plugins": "append" }            },

That is usless for "builder": "@angular-devkit/build-angular:browser",

Also in packege.json version of this devDependencies must be next:

"devDependencies": {    "@angular-devkit/build-angular": "0.900.7",    "@angular-devkit/build-optimizer": "0.900.7",

Initially, I installed the 0.901.0 version, but it didn't work. Link to issue

I hope I will help someone.