Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#1,186 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
68/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
node.js, typescript

Rechercherichtung

Beginne damit, findRescriptBinary() und runBuildWatcherUsingValidBuildPath() zu lesen, und verfolge dann, wie der zurückgegebene ReScript-Pfad unter Windows an childProcess.exec übergeben wird. Stelle sicher, dass der Watcher den vorhandenen node_modules/.bin/rescript.cmd-Launcher auflöst, ohne die anderen Verwendungen von findRescriptBinary() zu beeinträchtigen, und bestätige, dass Start Build nicht mehr sofort beendet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
ReScript
Sterne
356
Forks
63
Ø Merge
11 Std. 29 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus rescript-lang/rescript-vscode

Alle Issues in rescript-lang/rescript-vscode

Ähnliche Issues

Weitere Issues zu Build System

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.