Skip to content

Fix crash resolving ReScript v12+ binaries - #1193

Merged
fhammerschmidt merged 1 commit into
rescript-lang:masterfrom
jarednorman:fix-v12-binary-resolution-url
Sep 10, 2026
Merged

Fix crash resolving ReScript v12+ binaries#1193
fhammerschmidt merged 1 commit into
rescript-lang:masterfrom
jarednorman:fix-v12-binary-resolution-url

Conversation

@jarednorman

Copy link
Copy Markdown
Contributor

Fixes #1181

The language server crashes on startup with ERR_INVALID_URL for any project using ReScript >= 12.0.0-alpha.13, making the extension unusable with v12. This PR fixes the binary resolution so v12+ projects load again.

I ran into the issue when I was setting up the LSP with NeoVim on a fresh create-rescript-app Vite project. This change was admittedly AI-assisted, but it seemed relatively straightforward and has been manually confirmed to work at least on my setup.

findBinary passed a plain filesystem path to url.fileURLToPath, which
always throws ERR_INVALID_URL, crashing the language server on startup
for any ReScript >= 12.0.0-alpha.13 project. Convert the path with
url.pathToFileURL instead, which also keeps the dynamic import working
on Windows.

Fixes rescript-lang#1181

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11656c3148

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread shared/src/findBinary.ts

@fhammerschmidt fhammerschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, Jared!

I know you made a podcast episode with @jderochervlk!

Thanks for fixing this!

@fhammerschmidt
fhammerschmidt merged commit 76d3046 into rescript-lang:master Sep 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language Server Crashes Immediately When Trying To Run on Rescript V12 Project

2 participants