Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/angular/build/src/utils/load-proxy-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export async function loadProxyConfiguration(
break;
} catch (e) {
assertIsError(e);
if (e.code === 'ERR_REQUIRE_ESM') {
if (e.code === 'ERR_REQUIRE_ESM' || e.code === 'ERR_REQUIRE_ASYNC_MODULE') {
// Load the ESM configuration file using the TypeScript dynamic import workaround.
// Once TypeScript provides support for keeping the dynamic import this workaround can be
// changed to a direct dynamic import.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ async function getBuilder(builderPath: string): Promise<any> {
try {
return localRequire(builderPath);
} catch (e) {
if ((e as NodeJS.ErrnoException).code === 'ERR_REQUIRE_ESM') {
if (
(e as NodeJS.ErrnoException).code === 'ERR_REQUIRE_ESM' ||
(e as NodeJS.ErrnoException).code === 'ERR_REQUIRE_ASYNC_MODULE'
) {
// Load the ESM configuration file using the TypeScript dynamic import workaround.
// Once TypeScript provides support for keeping the dynamic import this workaround can be
// changed to a direct dynamic import.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ async function addProxyConfig(
proxyConfiguration = require(proxyPath);
} catch (e) {
assertIsError(e);
if (e.code !== 'ERR_REQUIRE_ESM') {
if (e.code !== 'ERR_REQUIRE_ESM' && e.code !== 'ERR_REQUIRE_ASYNC_MODULE') {
throw e;
}

Expand Down
5 changes: 4 additions & 1 deletion packages/angular_devkit/build_webpack/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ export async function getWebpackConfig(configPath: string): Promise<Configuratio
try {
return require(configPath);
} catch (e) {
if ((e as NodeJS.ErrnoException).code === 'ERR_REQUIRE_ESM') {
if (
(e as NodeJS.ErrnoException).code === 'ERR_REQUIRE_ESM' ||
(e as NodeJS.ErrnoException).code === 'ERR_REQUIRE_ASYNC_MODULE'
) {
// Load the ESM configuration file using the TypeScript dynamic import workaround.
// Once TypeScript provides support for keeping the dynamic import this workaround can be
// changed to a direct dynamic import.
Expand Down