Repository navigation
Description
Command
build
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
19.2.6
Description
When building with the default development configuration, if one is using JS decorators in a private method (not the experimental ones from TypeScript, experimentalDecorators: false) gets the following error:
If the method is public, the error doesn't happen.
This error doesn't happen in version 19.2.6.
Minimal Reproduction
Reproduction url: https://github.com/jordimarimon/angular-cli-js-decorator
The application has been created using the following command:
npx @angular/cli new test-app --experimental-zoneless --inline-style --inline-template --minimal --skip-git --skip-install --skip-tests --standalone --strict
There are only two additional files:
src/app/app.service.tssrc/app/debounce.ts
Run the command npx ng build --configuration=production and there shouldn't be any error.
Now run the command npx ng build --configuration=development and there should be an error.
If you downgrade to version 19.2.6 both commands run without any error.
Exception or Error
✘ [ERROR] Expected identifier but found "#foo"
src/app/app.service.ts:31:20:
31 │ }], () => [], { #foo: [] }); })();
╵ ~~~~
Your Environment
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 19.2.8
Node: 22.12.0
Package Manager: npm 11.3.0
OS: linux x64
Angular: 19.2.7
... common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1902.8
@angular-devkit/build-angular 19.2.8
@angular-devkit/core 19.2.8
@angular-devkit/schematics 19.2.8
@angular/cli 19.2.8
@schematics/angular 19.2.8
rxjs 7.8.2
typescript 5.7.3
zone.js 0.15.0
Anything else relevant?
No response

Activity
alan-agius4 commentedon Apr 22, 2025
This seem a regression caused by angular/angular-cli@6f913ad
JeanMeche commentedon Jul 10, 2025
I believe this has been fixed now.
angular-automatic-lock-bot commentedon Aug 12, 2025
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.