ESM builder with top-level await fails to load on node ≥ 20.19.0 #30286
Labels
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Command
build
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Node 20 has added support for
require()
to load ESM files, though only ESM files that don't use top-level await.This breaks the angular CLI loading those modules, since it now fails with with
ERR_REQUIRE_ASYNC_MODULE
rather thanERR_REQUIRE_ESM
angular-cli/packages/angular_devkit/architect/node/node-modules-architect-host.ts
Lines 322 to 335 in 259f8c5
Minimal Reproduction
Have a builder that uses top-level await, try to use the builder
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: