Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browserslist is ignored. #24697

Closed
1 task done
liesahead opened this issue Feb 10, 2023 · 3 comments · Fixed by #24698
Closed
1 task done

Browserslist is ignored. #24697

liesahead opened this issue Feb 10, 2023 · 3 comments · Fixed by #24698

Comments

@liesahead
Copy link

liesahead commented Feb 10, 2023

Command

build, serve, test

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

v14

Description

Browserlistrc is ignored for some reason and this warning was not present in v14.

Minimal Reproduction

Steps to reproduce

  1. Run ng new *proj_name*;
  2. Change target in tsconfig to ES2020;
  3. Run ng serve;
  4. See warning TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and "false" respectively by the Angular CLI. To control ECMA version and features use the Browerslist configuration.;
  5. Run ng generate config browserslist;
  6. Run ng serve;
  7. See warning TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and "false" respectively by the Angular CLI. To control ECMA version and features use the Browerslist configuration..

Your Environment

Angular CLI: 15.1.5
Node: 18.14.0
Package Manager: npm 9.4.2
OS: win32 x64

Angular: 15.1.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1501.5
@angular-devkit/build-angular   15.1.5
@angular-devkit/core            15.1.5
@angular-devkit/schematics      15.1.5
@angular/cli                    15.1.5
@schematics/angular             15.1.5
rxjs                            7.8.0
typescript                      4.9.5
@alan-agius4
Copy link
Collaborator

The ECMA version output controlled via the browserslist configuration. In this case "ES2020" in the TypeScript configuration is ignored and hence the warning.

You can set the "target" to "ES2022" in your TypeScript configuration to remove the warning.

alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Feb 10, 2023
…ssage to be more actionable

Update the `TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022"` warning message to be more actionable.

Closes: angular#24697
@alan-agius4 alan-agius4 self-assigned this Feb 10, 2023
@alan-agius4 alan-agius4 added the freq1: low Only reported by a handful of users who observe it rarely label Feb 10, 2023
angular-robot bot pushed a commit that referenced this issue Feb 10, 2023
…ssage to be more actionable

Update the `TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022"` warning message to be more actionable.

Closes: #24697
angular-robot bot pushed a commit that referenced this issue Feb 10, 2023
…ssage to be more actionable

Update the `TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022"` warning message to be more actionable.

Closes: #24697
(cherry picked from commit c65b026)
@liesahead
Copy link
Author

Thanks, it's clear now.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants