Repository navigation
Closed
Description
Command
build, 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
No response
Description
Hi.
After updating to rc3 my project is not going to compile/build. Also my build process in dev server is never-ending and doesn't give me error.
Also i see these errors, which are not true, because they are persist in my tsconfig and everything seems to be building on rc2:
File 'server.ts' is missing from the TypeScript compilation
File 'src\main.server.ts' is missing from the TypeScript compilation.
I ran schematics to migrate to new control flow, maybe this is related.
Still need to review 400 components and will give you repro.
Minimal Reproduction
ng serve / ng build
Exception or Error
X [ERROR] Cannot read properties of undefined (reading 'startName') [plugin angular-compiler]
This error came from the "onStart" callback registered here:
node_modules/@angular-devkit/build-angular/src/tools/esbuild/angular/compiler-plugin.js:89:18:
89 │ build.onStart(async () => {
╵ ~~~~~~~
at setup (C:\node_modules\@angular-devkit\build-angular\src\tools\esbuild\angular\compiler-plugin.js:89:19)
at async handlePlugins (C:\node_modules\esbuild\lib\main.js:1340:9)
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\main.server.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 'server.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.
Application bundle generation failed. [17.522 seconds]
Your Environment
Angular CLI: 17.0.0-rc.3
Node: 18.18.1
Package Manager: npm 9.8.1
OS: win32 x64
Angular: 17.0.0-rc.2
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, material, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1700.0-rc.3
@angular-devkit/build-angular 17.0.0-rc.3
@angular-devkit/core 17.0.0-rc.3
@angular-devkit/schematics 17.0.0-rc.3
@angular/cli 17.0.0-rc.3
@angular/ssr 17.0.0-rc.3
@schematics/angular 17.0.0-rc.3
rxjs 7.8.1
typescript 5.2.2
zone.js 0.14.0
Anything else relevant?
No response
Activity
alan-agius4 commentedon Nov 6, 2023
This seems like a bug but we'll need to look at a reproduction to find and fix the problem. Can you setup a minimal repro please?
You can read here why this is needed. A good way to make a minimal repro is to create a new app via
ng new repro-appand adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.This might be related to your directory structure so its really important to get an accurate repro to diagnose this.
zip-fa commentedon Nov 6, 2023
@alan-agius4 i can confirm that this exists on rc2, rc1 and rc2.
Also i don't have any output on esbuild-builder/application builder, but i receive bunch of errors on good-old browser builder.
I will need more time to investigate what exactly caused this, because i tried to migrate my whole project, which consists of ~400 components
zip-fa commentedon Nov 6, 2023
@alan-agius4 i was doing a repro with @for bug, but this error encountered:
https://stackblitz.com/edit/angular-at-rb12vs?file=src%2Fmain.ts
clydin commentedon Nov 6, 2023
That appears to be a defect in Web Containers (used inside StackBlitz).
You should be able to workaround the bug by changing the
package.jsonstart script to:EDIT: This comment was related to the previous comment's issue (#52540) and not the issue reported originally.
zip-fa commentedon Nov 6, 2023
I receive same error on my Windows PC. Will try to reproduce.
zip-fa commentedon Nov 6, 2023
I managed to reproduce what caused this behavior.
Take a look at this:
https://github.com/zip-fa/ng17-i18n-control-flow-bug
control flow inside i18n block leads to never-ending build with esbuild-based builders on Windows system, while with browser builder it throws this error:
zip-fa commentedon Nov 6, 2023
@alan-agius4 that happened after automatic migration from *ngIf to control flow. This is the code, which was working before:
alan-agius4 commentedon Nov 6, 2023
Transfer to the FW repo since this is not caused by the CLI.
zip-fa commentedon Nov 7, 2023
But with esbuild-builders there is no visible errors on Windows PC, it just shows “Building…” text in console indefinitely. On other hand, webpack gives trace to what caused this
alan-agius4 commentedon Nov 7, 2023
That solved the solved in the latest RC
vpallathu commentedon Nov 13, 2023
I still see the error with version v17.0.0. I don't see any new npm version than v17.0.0. Should I use the interim version v17.0.2?
fix(compiler): generate i18n instructions for blocks (#52958)
angular-automatic-lock-bot commentedon Dec 21, 2023
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.
fix(compiler): generate i18n instructions for blocks (angular#52958)
fix(compiler): generate i18n instructions for blocks (angular#52958)
fix(compiler): generate i18n instructions for blocks (angular#52958)
fix(compiler): generate i18n instructions for blocks (angular#52958)