Skip to content

Commit 748d681

Browse files
Coly010FrozenPandaz
authored andcommitted
fix(js): esm loader should handle absolute paths on windows #32376 (#32383)
## Current Behavior ESM Loader for Windows is not working because it is encountering an absolute path that is not using the `file://` protocol. ## Expected Behavior Ensure that when loading the `esm-loader`, it uses the file protocol ## Related Issue(s) Fixes #32376 (cherry picked from commit b5439b9)
1 parent 61db87e commit 748d681

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/js/src/executors/node/node-with-esm-loader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async function main() {
99
try {
1010
// Register ESM loader for workspace path mappings
1111
register(
12-
path.join(__dirname, 'lib', 'esm-loader.js'),
12+
pathToFileURL(path.join(__dirname, 'lib', 'esm-loader.js')).href,
1313
pathToFileURL(__filename)
1414
);
1515

packages/js/src/executors/node/node.impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export async function* nodeExecutor(
180180
: 'node-with-require-overrides';
181181

182182
task.childProcess = fork(
183-
joinPathFragments(__dirname, loaderFile),
183+
join(__dirname, loaderFile),
184184
options.args ?? [],
185185
{
186186
execArgv: getExecArgv(options),

0 commit comments

Comments
 (0)