@@ -20,7 +20,6 @@ const globalAgent = require('../globalAgent');
2020const portFinder = require ( './portfinder' ) ;
2121const sslDir = path . join ( __dirname , '..' , 'apps' , 'ssl' ) ;
2222const cert = fs . readFileSync ( path . join ( sslDir , 'cert' ) ) ;
23- const isLatestEsmSupportedVersion = require ( '@instana/core' ) . util . esm . isLatestEsmSupportedVersion ;
2423
2524class ProcessControls {
2625 /**
@@ -57,10 +56,7 @@ class ProcessControls {
5756 }
5857
5958 if ( process . env . RUN_ESM && ! opts . execArgv ) {
60- const resolveEsmLoader = ( ) =>
61- isLatestEsmSupportedVersion ( process . versions . node )
62- ? [ `--import=${ path . join ( __dirname , '..' , '..' , 'esm-register.mjs' ) } ` ]
63- : [ `--experimental-loader=${ path . join ( __dirname , '..' , '..' , 'esm-loader.mjs' ) } ` ] ;
59+ const esmLoader = [ `--import=${ path . join ( __dirname , '..' , '..' , 'esm-register.mjs' ) } ` ] ;
6460
6561 try {
6662 // Custom appPath is provided, use that. here we check the exact file name for esm app
@@ -72,13 +68,13 @@ class ProcessControls {
7268 const esmApp = testUtils . checkESMApp ( { appPath : updatedPath } ) ;
7369
7470 if ( esmApp ) {
75- opts . execArgv = resolveEsmLoader ( ) ;
71+ opts . execArgv = esmLoader ;
7672 opts . appPath = updatedPath ;
7773 }
7874 } else if ( opts ?. dirname ) {
7975 const esmApp = testUtils . checkESMApp ( { appPath : path . join ( opts . dirname , 'app.mjs' ) } ) ;
8076 if ( esmApp ) {
81- opts . execArgv = resolveEsmLoader ( ) ;
77+ opts . execArgv = esmLoader ;
8278 opts . appPath = path . join ( opts . dirname , 'app.mjs' ) ;
8379 }
8480 }
0 commit comments