Skip to content

class private methods are not enabled #24411

@dzonatan

Description

@dzonatan

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

15.0.2

Description

Class private methods no longer works with @angular-devkit/build-angular@15.0.3.

Minimal Reproduction

  • ng new repro-app
  • add an empty private method to the app.component.ts, e.g.:
    #myPrivateMethod() {}
  • ng serve

Exception or Error

./src/app/app.component.ts - Error: Module build failed (from ./node_modules/@angular-devkit/build-a
ngular/src/babel/webpack-loader.js):
SyntaxError: /Users/dzonatan/dev/sandbox/ng15/src/app/app.component.ts: Class private methods are no
t enabled. Please add `@babel/plugin-proposal-private-methods` to your configuration.
  37 |     
> 38 |     #myPrivateMethod() {
     |     ^
  39 |     }
...

Your Environment

Angular CLI: 15.0.3
Node: 16.18.0
Package Manager: npm 8.19.2
OS: darwin arm64

Angular: 15.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1500.3
@angular-devkit/build-angular   15.0.3
@angular-devkit/core            15.0.0
@angular-devkit/schematics      14.2.9
@angular/cdk                    15.0.2
@schematics/angular             15.0.3
ng-packagr                      15.0.3
rxjs                            7.5.7
typescript                      4.8.4

Anything else relevant?

I believe #24357 was a cause.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy