(path: string)
| 58 | * the meaningful one (the fallback usually fails with an unrelated URL error). |
| 59 | */ |
| 60 | async function importTaskModule(path: string) { |
| 61 | try { |
| 62 | return await import(path); |
| 63 | } catch (firstError) { |
| 64 | try { |
| 65 | return await import(fileURLToPath(path)); |
| 66 | } catch { |
| 67 | throw firstError; |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | function sendEvent(event: TaskEvent, context: TaskContext) { |
| 73 | const message: any = { event: event, context: safelySerializeContext(context) }; |