File tree 4 files changed +10
-4
lines changed
build_angular/src/tools/webpack/configs
4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ export async function loadProxyConfiguration(
67
67
break ;
68
68
} catch ( e ) {
69
69
assertIsError ( e ) ;
70
- if ( e . code === 'ERR_REQUIRE_ESM' ) {
70
+ if ( e . code === 'ERR_REQUIRE_ESM' || e . code === 'ERR_REQUIRE_ASYNC_MODULE' ) {
71
71
// Load the ESM configuration file using the TypeScript dynamic import workaround.
72
72
// Once TypeScript provides support for keeping the dynamic import this workaround can be
73
73
// changed to a direct dynamic import.
Original file line number Diff line number Diff line change @@ -324,7 +324,10 @@ async function getBuilder(builderPath: string): Promise<any> {
324
324
try {
325
325
return localRequire ( builderPath ) ;
326
326
} catch ( e ) {
327
- if ( ( e as NodeJS . ErrnoException ) . code === 'ERR_REQUIRE_ESM' ) {
327
+ if (
328
+ ( e as NodeJS . ErrnoException ) . code === 'ERR_REQUIRE_ESM' ||
329
+ ( e as NodeJS . ErrnoException ) . code === 'ERR_REQUIRE_ASYNC_MODULE'
330
+ ) {
328
331
// Load the ESM configuration file using the TypeScript dynamic import workaround.
329
332
// Once TypeScript provides support for keeping the dynamic import this workaround can be
330
333
// changed to a direct dynamic import.
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ async function addProxyConfig(
210
210
proxyConfiguration = require ( proxyPath ) ;
211
211
} catch ( e ) {
212
212
assertIsError ( e ) ;
213
- if ( e . code !== 'ERR_REQUIRE_ESM' ) {
213
+ if ( e . code !== 'ERR_REQUIRE_ESM' && e . code !== 'ERR_REQUIRE_ASYNC_MODULE' ) {
214
214
throw e ;
215
215
}
216
216
Original file line number Diff line number Diff line change @@ -90,7 +90,10 @@ export async function getWebpackConfig(configPath: string): Promise<Configuratio
90
90
try {
91
91
return require ( configPath ) ;
92
92
} catch ( e ) {
93
- if ( ( e as NodeJS . ErrnoException ) . code === 'ERR_REQUIRE_ESM' ) {
93
+ if (
94
+ ( e as NodeJS . ErrnoException ) . code === 'ERR_REQUIRE_ESM' ||
95
+ ( e as NodeJS . ErrnoException ) . code === 'ERR_REQUIRE_ASYNC_MODULE'
96
+ ) {
94
97
// Load the ESM configuration file using the TypeScript dynamic import workaround.
95
98
// Once TypeScript provides support for keeping the dynamic import this workaround can be
96
99
// changed to a direct dynamic import.
You can’t perform that action at this time.
0 commit comments