File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed
build_angular/src/tools/webpack/configs Expand file tree Collapse file tree 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(
6767 break ;
6868 } catch ( e ) {
6969 assertIsError ( e ) ;
70- if ( e . code === 'ERR_REQUIRE_ESM' ) {
70+ if ( e . code === 'ERR_REQUIRE_ESM' || e . code === 'ERR_REQUIRE_ASYNC_MODULE' ) {
7171 // Load the ESM configuration file using the TypeScript dynamic import workaround.
7272 // Once TypeScript provides support for keeping the dynamic import this workaround can be
7373 // 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> {
324324 try {
325325 return localRequire ( builderPath ) ;
326326 } 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+ ) {
328331 // Load the ESM configuration file using the TypeScript dynamic import workaround.
329332 // Once TypeScript provides support for keeping the dynamic import this workaround can be
330333 // changed to a direct dynamic import.
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ async function addProxyConfig(
210210 proxyConfiguration = require ( proxyPath ) ;
211211 } catch ( e ) {
212212 assertIsError ( e ) ;
213- if ( e . code !== 'ERR_REQUIRE_ESM' ) {
213+ if ( e . code !== 'ERR_REQUIRE_ESM' && e . code !== 'ERR_REQUIRE_ASYNC_MODULE' ) {
214214 throw e ;
215215 }
216216
Original file line number Diff line number Diff line change @@ -90,7 +90,10 @@ export async function getWebpackConfig(configPath: string): Promise<Configuratio
9090 try {
9191 return require ( configPath ) ;
9292 } 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+ ) {
9497 // Load the ESM configuration file using the TypeScript dynamic import workaround.
9598 // Once TypeScript provides support for keeping the dynamic import this workaround can be
9699 // changed to a direct dynamic import.
You can’t perform that action at this time.
0 commit comments