Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Windows: Start Build uses an invalid .cmd path after findBinary refactor

未关闭
#1,186 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
node.js, typescript

调研方向

先阅读 findRescriptBinary() 和 runBuildWatcherUsingValidBuildPath(),然后跟踪返回的 ReScript 路径在 Windows 上是如何传递给 childProcess.exec 的。验证 watcher 能够解析现有的 node_modules/.bin/rescript.cmd 启动器,同时不影响 findRescriptBinary() 的其他使用方式,并确认 Start Build 不再立即退出。

由索引模型根据 Issue 内容生成。

描述

Summary

Starting a build from the language server fails on Windows because the path returned by findRescriptBinary() no longer matches what runBuildWatcherUsingValidBuildPath() expects.

The build watcher exits immediately with:

Build watcher exited with code 1, signal null

As a result, features that depend on the build watcher (such as fresh type information) do not work until a separate rescript watch process is started manually.

Environment

  • OS: Windows 10
  • Extension: 1.73.11
  • ReScript: 12.3.0 (also reproduced on 12.0.0)

Investigation

In extension version 1.50.0, findRescriptBinary() searched for:

node_modules/.bin/rescript

runBuildWatcherUsingValidBuildPath() then executed:

childProcess.exec(`"${buildPath}".cmd ...`)

which correctly resolved to:

node_modules/.bin/rescript.cmd

The current implementation of findRescriptBinary() returns the package wrapper instead.

For ReScript 12:

node_modules/rescript/cli/rescript.js

For older ReScript versions (10, 11):

node_modules/rescript/rescript

However, runBuildWatcherUsingValidBuildPath() still appends .cmd:

".../node_modules/rescript/cli/rescript.js".cmd

or

".../node_modules/rescript/rescript".cmd

Neither of these files exists.

The actual Windows launcher generated by npm is still:

node_modules/.bin/rescript.cmd

Logs

Starting build watcher for ... (ReScript 12.3.0)
Running build watcher: ...\node_modules\rescript\cli\rescript.js watch
Build watcher exited with code 1, signal null

Possible fix

Since findRescriptBinary() is now also used for purposes other than starting the build watcher (for example, monorepo-related logic), changing it back to return node_modules/.bin/rescript may not be the best approach.

Instead, runBuildWatcherUsingValidBuildPath() could resolve the appropriate Windows launcher from the returned path before calling exec(), preserving the current responsibilities of findRescriptBinary() while restoring the expected Windows behavior.

Related

This appears to be related to issue #1181.

That issue reports that Start Build exits immediately while running rescript watch manually works correctly. My investigation points to the Windows launcher path being constructed from a different kind of path than the code expects.

主要语言
ReScript
星标
356
派生
63
平均合并
11 小时 29 分钟
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rescript-lang/rescript-vscode 的其他 Issue

查看 rescript-lang/rescript-vscode 的全部 Issue

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。