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

Node.js v22.2 causes ng build hangs up #27674

Closed
1 task
lacolaco opened this issue May 22, 2024 · 6 comments · May be fixed by #27721
Closed
1 task

Node.js v22.2 causes ng build hangs up #27674

lacolaco opened this issue May 22, 2024 · 6 comments · May be fixed by #27721

Comments

@lacolaco
Copy link
Contributor

lacolaco commented May 22, 2024

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

No response

Description

When the Node.js version is v22.2.0 (released on 2024-05-15), the ng build command hangs up. Node.js v22.1.0 doesn't.
Angular CLI is not supporting that version of Node.js officially, but on Firebase App Hosting, the build environment is using Node.js v22.2 today by default. So it is an easy situation for developers to get stumped.

My workaround is to set engines.node field in package.json as "20". App Hosting builder can determine the Node.js version to install.

Minimal Reproduction

  • set Node.js version to v22.2.0
  • ng new on @angular/cli@latest (v17.3.7)
  • ng build
  • print Building... and never finished.

Exception or Error

No response

Your Environment

Angular CLI: 17.3.7
Node: 22.2.0 (Unsupported)
Package Manager: pnpm 8.15.6
OS: darwin arm64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1703.7
@angular-devkit/build-angular   17.3.7
@angular-devkit/core            17.3.7
@angular-devkit/schematics      17.3.7
@angular/cli                    17.3.7
@angular/ssr                    17.3.7
@schematics/angular             17.3.7
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.6
    
Warning: The current version of Node (22.2.0) is not supported by Angular.

Anything else relevant?

No response

@JoostK
Copy link
Member

JoostK commented May 22, 2024

Does this repro using Angular 18 RCs?

@lacolaco
Copy link
Contributor Author

lacolaco commented May 22, 2024

@JoostK Yes, it reproduces the same situation even after ng update @angular/core @angular/cli --next.

Angular CLI: 18.0.0-rc.3
Node: 22.2.0
Package Manager: pnpm 8.15.6
OS: darwin arm64

Angular: 18.0.0-rc.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1800.0-rc.3
@angular-devkit/build-angular   18.0.0-rc.3
@angular-devkit/core            18.0.0-rc.3
@angular-devkit/schematics      18.0.0-rc.3
@schematics/angular             18.0.0-rc.3
rxjs                            7.8.1
typescript                      5.4.5
zone.js                         0.14.6

@alan-agius4
Copy link
Collaborator

Unfortunately, this is a regression introduced by Node.js, and it's not something we can address on our end. For more details, see: Node.js Issue #53097.

@alan-agius4
Copy link
Collaborator

It seems that the "regression" was intentional from Node.js' perspective. Unfortunately, this breaking behaviour happened in a minor version of Node.js, We will need to put in some work to address it on our end as it's not as trivial to solve.

@alan-agius4
Copy link
Collaborator

There has been a revert in Node.js that will fix this in their next release. See: nodejs/TSC#1566 (comment) for more information.

@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 Jul 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.