Skip to content

Commit 76d3046

Browse files
Merge pull request #1193 from jarednorman/fix-v12-binary-resolution-url
Fix crash resolving ReScript v12+ binaries
2 parents f29d6a0 + 11656c3 commit 76d3046

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#### :bug: Bug fix
1616

17+
- Fix language server crash (`ERR_INVALID_URL`) when resolving platform binaries for ReScript v12+ projects. https://github.com/rescript-lang/rescript-vscode/issues/1181
18+
1719
#### :rocket: New Feature
1820

1921
#### :house: Internal

‎shared/src/findBinary.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ export const findBinary = async ({
116116
"..",
117117
`@rescript/${target}/bin.js`,
118118
);
119-
const { binPaths } = await import(url.fileURLToPath(targetPackagePath));
119+
const { binPaths } = await import(
120+
url.pathToFileURL(targetPackagePath).href
121+
);
120122

121123
if (binary === "bsc.exe") {
122124
binaryPath = binPaths.bsc_exe;

0 commit comments

Comments
 (0)