diff --git a/src/classes/child-processor.ts b/src/classes/child-processor.ts index 98ea85b0e5..cea4a7cf2c 100644 --- a/src/classes/child-processor.ts +++ b/src/classes/child-processor.ts @@ -28,7 +28,12 @@ export class ChildProcessor { let processor; try { const { default: processorFn } = await import(processorFile); - processor = processorFn; + + if (processorFn instanceof Promise) { + processor = await processorFn; + } else { + processor = processorFn; + } if (processor.default) { // support es2015 module.