@@ -317,6 +317,7 @@ export async function buildExecutionContext(
317317
318318 const runInVM = async ( renderingRequest : string , bundleFilePath : string , vmCluster ?: typeof cluster ) => {
319319 try {
320+ const { bundlePath } = getConfig ( ) ;
320321 const vmContext = mapBundleFilePathToVMContext . get ( bundleFilePath ) ;
321322 if ( ! vmContext ) {
322323 throw new VMContextNotFoundError ( bundleFilePath ) ;
@@ -332,7 +333,7 @@ export async function buildExecutionContext(
332333 const workerId = vmCluster ?. worker ?. id ;
333334 log . debug ( `worker ${ workerId ? `${ workerId } ` : '' } received render request for bundle ${ bundleFilePath } with code
334335 ${ smartTrim ( renderingRequest ) } ` ) ;
335- const debugOutputPathCode = path . join ( bundleFilePath , 'code.js' ) ;
336+ const debugOutputPathCode = path . join ( bundlePath , 'code.js' ) ;
336337 log . debug ( `Full code executed written to: ${ debugOutputPathCode } ` ) ;
337338 await writeFileAsync ( debugOutputPathCode , renderingRequest ) ;
338339 }
@@ -368,7 +369,7 @@ export async function buildExecutionContext(
368369 if ( log . level === 'debug' ) {
369370 log . debug ( `result from JS:
370371 ${ smartTrim ( result ) } ` ) ;
371- const debugOutputPathResult = path . join ( bundleFilePath , 'result.json' ) ;
372+ const debugOutputPathResult = path . join ( bundlePath , 'result.json' ) ;
372373 log . debug ( `Wrote result to file: ${ debugOutputPathResult } ` ) ;
373374 await writeFileAsync ( debugOutputPathResult , result ) ;
374375 }
0 commit comments