From ca69167b6419ce27b2d3cb93ed4a5a7fd13f84d5 Mon Sep 17 00:00:00 2001 From: Theo Crandall <64854392+thrandale@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:25:52 -0600 Subject: [PATCH] fix(core): import mjs path correctly when running on windows (#2662) --- packages/core/lib/runner.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/core/lib/runner.js b/packages/core/lib/runner.js index 045ab774e8..037ef0451b 100644 --- a/packages/core/lib/runner.js +++ b/packages/core/lib/runner.js @@ -18,6 +18,7 @@ const isIdlePhase = require('./is-idle-phase'); const createReader = require('./readers'); const engineUtil = require('@artilleryio/int-commons').engine_util; const wl = require('./weighted-pick'); +const { pathToFileURL } = require('url'); const Engines = { http: require('./engine_http'), @@ -86,7 +87,8 @@ async function loadProcessor(script, options) { ); if (processorPath.endsWith('.mjs')) { - const exports = await import(processorPath); + const fileUrl = pathToFileURL(processorPath); + const exports = await import(fileUrl.href); script.config.processor = Object.assign( {}, script.config.processor,