Skip to content

Commit

Permalink
fix(core): import mjs path correctly when running on windows (#2662)
Browse files Browse the repository at this point in the history
  • Loading branch information
thrandale authored Jul 29, 2024
1 parent 3386026 commit ca69167
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ca69167

Please sign in to comment.