Skip to content

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

Closed

Description

@lacolaco

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

Activity

  1. JoostK commented on May 22, 2024

    @JoostK
    Member

    Does this repro using Angular 18 RCs?

  2. lacolaco commented on May 22, 2024

    @lacolaco
    ContributorAuthor

    @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
    
  3. alan-agius4 commented on May 22, 2024

    @alan-agius4
    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.

  4. alan-agius4 commented on May 23, 2024

    @alan-agius4
    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.

  5. self-assigned this
    on May 23, 2024
  6. added and removed
    freq1: lowOnly reported by a handful of users who observe it rarely
    on May 23, 2024
  7. alan-agius4 commented on Jun 3, 2024

    @alan-agius4
    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.

  8. angular-automatic-lock-bot commented on Jul 4, 2024

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions