diff --git a/CHANGELOG.md b/CHANGELOG.md index 98d6c2522..9ea4025dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ #### :bug: Bug fix +- Fix language server crash (`ERR_INVALID_URL`) when resolving platform binaries for ReScript v12+ projects. https://github.com/rescript-lang/rescript-vscode/issues/1181 + #### :rocket: New Feature #### :house: Internal diff --git a/shared/src/findBinary.ts b/shared/src/findBinary.ts index 090157715..902679ba8 100644 --- a/shared/src/findBinary.ts +++ b/shared/src/findBinary.ts @@ -116,7 +116,9 @@ export const findBinary = async ({ "..", `@rescript/${target}/bin.js`, ); - const { binPaths } = await import(url.fileURLToPath(targetPackagePath)); + const { binPaths } = await import( + url.pathToFileURL(targetPackagePath).href + ); if (binary === "bsc.exe") { binaryPath = binPaths.bsc_exe;