Repository navigation
Closed
Labels
angular/build:applicationarea: @angular-devkit/build-angularfreq1: lowOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix
Description
Command
serve
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
16, might've worked in an earlier 17.0.x version
Description
When using "aot": false, there are two critical issues with ng serve.
.htmlfiles do not seem to be watched, so changes do not trigger a rebuild/refresh.- Saving
.tsfiles trigger a rebuild, but the build always fail (see error below). NOTE: Does not happen on every save, but can be reproduced consistently.
The above means that ng serve has to be exited and re-run on every change, which makes it pretty much unusable.
Minimal Reproduction
ng new myprojectcd myproject- Add
"aot": falseto the angular.json builder options (projects.myproject.architect.build.options.aot) ng serve- Make changes to and save
app.component.htmlandapp.component.ts
Exception or Error
Two issues:
1. Changes to `app.component.html` does not trigger rebuild. The only way for the changes to take effect is to quit and run `ng serve` again.
2. When saving `app.component.ts`, an error is shown:
⠋ Changes detected. Rebuilding...
✘ [ERROR] File 'src/app/app.component.ts' is missing from the TypeScript compilation. [plugin angular-compiler]
src/main.ts:3:29:
3 │ import { AppComponent } from './app/app.component';
╵ ~~~~~~~~~~~~~~~~~~~~~
Ensure the file is part of the TypeScript program via the 'files' or 'include' property.
Your Environment
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 17.0.6
Node: 20.9.0
Package Manager: npm 10.2.3
OS: darwin arm64
Angular: 17.0.6
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1700.6
@angular-devkit/build-angular 17.0.6
@angular-devkit/core 17.0.6
@angular-devkit/schematics 17.0.6
@schematics/angular 17.0.6
rxjs 7.8.1
typescript 5.2.2
zone.js 0.14.2
Anything else relevant?
This happens both with the browser-eslint and the application builder.
Related: #26379
Metadata
Metadata
Assignees
Labels
angular/build:applicationarea: @angular-devkit/build-angularfreq1: lowOnly reported by a handful of users who observe it rarelyseverity3: brokentype: bug/fix
Activity
anhallbe commentedon Dec 12, 2023
After more investigation:
The "File is missing from the Typescript compilation" issue appear to only happen when saving a
.tsfile that doesn't have any changes. This is an annoyance, but not as critical as the first issue (html files are not watched).I also tested all versions of
@angular-devkit/build-angularin the range 17.0.[0-6]. The.htmlissue can be reproduced in all of them.I am no longer sure if this is a regression or if it has always been there with the
"application"/"browser-esbuild"builder together with"aot": false. We only changed to the new builder with the 17 upgrade.fix(@angular-devkit/build-angular): file is missing from the TypeScri…
alan-agius4 commentedon Dec 12, 2023
Hi @anhallbe,
Thanks for reporting this issue and finding the root. I can confirm that the problem is indeed related to saving unmodified files.
Both reported issues should be solved with #26636 and #26640.
anhallbe commentedon Dec 12, 2023
@alan-agius4 nice!
I tried the following, and it looks like the
.htmlfile issue is resolved:fix(@angular-devkit/build-angular): file is missing from the TypeScri…
fix(@angular-devkit/build-angular): file is missing from the TypeScri…
angular-automatic-lock-bot commentedon Jan 12, 2024
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.