Skip to content

Yarn fails to build Angular with recent Node.js versions #53334

Closed

Description

Which @angular/* package(s) are the source of the bug?

core

Is this a regression?

Yes

Description

Node.js v18.18.2 successfully builds but v18.19.0 and v20.9.0 both fail with the same error message.

To replicate the issue, run the following commands:

gh repo clone johnnygerard/angular
cd angular
yarn install
yarn build

Note that the Yarn build was done on my fork of Angular which is synced.
Last commit: acd6100

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

(main) $ yarn build
yarn run v1.22.19
$ ts-node --esm --project scripts/tsconfig.json scripts/build/build-packages-dist.mts
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".mts" for ~/test/angular_20_9_0/scripts/build/build-packages-dist.mts
    at new NodeError (node:internal/errors:406:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:99:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:142:36)
    at defaultLoad (node:internal/modules/esm/load:120:20)
    at nextLoad (node:internal/modules/esm/hooks:833:28)
    at load (~/test/angular_20_9_0/node_modules/ts-node/dist/child/child-loader.js:19:122)
    at nextLoad (node:internal/modules/esm/hooks:833:28)
    at Hooks.load (node:internal/modules/esm/hooks:416:26)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:807:20) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
(main) $ node --version
v20.9.0

Please provide the environment you discovered this bug in (run ng version)

OS: Ubuntu 22.04.3 LTS
Shell: GNU bash v5.1.16

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area: dev-infraIssues related to Angular's own dev infra (build, test, CI, releasing)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions