Error updated Angular to version 17 when I compile

After I updated Angular to version 17, it is giving this error when I compile

  • Building… X [ERROR] File ‘src\main.ts’ is missing from the TypeScript compilation. [plugin angular-compiler] Ensure the file is part of the TypeScript program via the ‘files’ or ‘include’ property. X [ERROR] File ‘src\polyfills.ts’ is missing from the TypeScript compilation. [plugin angular-compiler] angular:polyfills:angular:polyfills:1:7: 1 │ import ‘./src/polyfills.ts’; ╵ ~~~~~~~~~~~~~~~~~~~~ Ensure the file is part of the TypeScript program via the ‘files’ or ‘include’ property. [e[40mERRORe[49m] An error occurred while running subprocess ng. ng.cmd run app:build:production exited with exit code 1. Re-running this command with the --verbose flag may provide more information.
2 Likes

I have the same error

FIXED: Add

“options”: {
“preserveSymlinks”: true,

In angular.json

By the way: why is Angular 17 even recommended at this early stage via the VS Ionic plugin? There are still too many dependencies on Angular 16.

@angular-devkit/build-angular           ^16.2.10  →  ^17.0.1
 @angular-eslint/builder                  ^16.3.1  →  ^17.1.0
 @angular-eslint/eslint-plugin            ^16.3.1  →  ^17.1.0
 @angular-eslint/eslint-plugin-template   ^16.3.1  →  ^17.1.0
 @angular-eslint/schematics               ^16.3.1  →  ^17.1.0
 @angular-eslint/template-parser          ^16.3.1  →  ^17.1.0
 @angular/cli                            ^16.2.10  →  ^17.0.1
 @angular/compiler-cli                   ^16.2.12  →  ^17.0.3
 @angular/forms                          ^16.2.12  →  ^17.0.3
 @angular/language-service                16.2.12  →   17.0.3
 @angular/router                         ^16.2.12  →  ^17.0.3
 @angular/service-worker                 ^16.2.12  →  ^17.0.3
 @types/node                              ^20.9.0  →  ^20.9.1
 typescript                                ^5.1.6  →   ^5.2.2

Ignored incompatible updates (peer dependencies):

 @angular/animations                ^16.2.12  →  ^17.0.3  reason: @angular/platform-browser requires 16.2.12
 @angular/common                    ^16.2.12  →  ^17.0.3  reason: @angular/fire requires ^16.0.0, @angular/platform-browser requires 16.2.12, @angular/platform-browser-dynamic requires 16.2.12
 @angular/compiler                  ^16.2.12  →  ^17.0.3  reason: @angular/platform-browser-dynamic requires 16.2.12
 @angular/core                      ^16.2.12  →  ^17.0.3  reason: @angular/animations requires 16.2.12, @angular/common requires 16.2.12, @angular/compiler requires 16.2.12, @angular/fire requires ^16.0.0, @angular/platform-browser requires 16.2.12, @angular/platform-browser-dynamic requires 16.2.12
 @angular/platform-browser          ^16.2.12  →  ^17.0.3  reason: @angular/fire requires ^16.0.0, @angular/platform-browser-dynamic requires 16.2.12
 @angular/platform-browser-dynamic  ^16.2.12  →  ^17.0.3  reason: @angular/fire requires ^16.0.0
 zone.js                              0.13.3  →   0.14.2  reason: @angular/core requires ~0.13.0