Skip to content

fix(dev): launch Vite through its Node entry point on Windows - #3534

Open
sumit-m wants to merge 1 commit into
block:mainfrom
sumit-m:windows-dev-launch
Open

fix(dev): launch Vite through its Node entry point on Windows#3534
sumit-m wants to merge 1 commit into
block:mainfrom
sumit-m:windows-dev-launch

Conversation

@sumit-m

@sumit-m sumit-m commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Launches Vite through its Node entry point in scripts/instance-env.sh, so just dev starts on Windows.

Tauri runs beforeDevCommand through cmd /C on Windows, which has no exec builtin and cannot execute the extensionless ./node_modules/.bin/vite shim (only vite.CMD / vite.ps1 are executable there). just dev therefore fails before the app window ever appears.

node ./node_modules/vite/bin/vite.js is portable, and exec is kept on every other platform so Tauri's Ctrl+C still reaches Vite directly rather than leaving it parented to the shell.

Both BUZZ_TAURI_CONFIG assignments are covered — the plain one and the worktree variant.

Related issue

Part of #2388 (Windows Support).

Complements #3515, which applies the same Node entry point to desktop/src-tauri/tauri.conf.json. The two do not overlap, and either can merge first.

Worth flagging for reviewers of both PRs: the four recipes that start Tauri (Justfile lines 472, 501, 528, 555) all pass --config "$BUZZ_TAURI_CONFIG", and that merged override carries its own beforeDevCommand built here in instance-env.sh. It therefore wins over the value in tauri.conf.json, so #3515 alone does not unblock those recipes on Windows — this change is what does. #3515 covers a bare pnpm tauri dev invocation, which reads tauri.conf.json directly.

(#3515's description mentions just desktop-dev; that recipe runs pnpm exec vite directly without invoking Tauri, so it never reads beforeDevCommand and is unaffected on either side.)

Testing

Verified on Windows 11 (Git Bash, MINGW64_NT-10.0):

  • node ./node_modules/vite/bin/vite.js --version from desktop/vite/8.0.16 win32-x64 node-v24.15.0
  • Sourcing the script emits valid JSON with the expected command:
    beforeDevCommand: node ./node_modules/vite/bin/vite.js --port 43252 --strictPort
    identifier: xyz.block.buzz.app.dev
    
  • just dev reaches the running desktop app; before this change it exited during startup.
  • Platform branch exercised both ways via the existing BUZZ_TEST_PLATFORM override — Darwin yields the exec form, MINGW64_NT-10.0 yields the bare form.
  • bash -n scripts/instance-env.sh clean.

Not verified: signal delivery on macOS/Linux is unchanged by inspection (exec retained), but I have no Apple or Linux hardware to confirm Ctrl+C behaviour end to end.

@sumit-m
sumit-m requested a review from a team as a code owner July 29, 2026 13:48
@sumit-m
sumit-m force-pushed the windows-dev-launch branch 2 times, most recently from 61860ee to 9b10dd4 Compare July 29, 2026 14:52

@Chessing234 Chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Practical Windows fix — cmd /C can't exec the extensionless Vite shim, and node ./node_modules/vite/bin/vite.js is the portable entry point. Keeping exec on unix preserves Tauri's Ctrl-C process-group behavior. LGTM.

@Chessing234 Chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving the Windows Vite Node entry-point fix.

Tauri runs beforeDevCommand through cmd /C on Windows, which has no exec
and cannot execute the extensionless .bin/vite shim, so just dev fails
before the app starts. Vite's Node entry point is portable; exec is kept
elsewhere so Tauri's Ctrl+C still reaches Vite directly.

Complements block#3515, which fixes the same launch for tauri.conf.json but
not for the instance-env.sh path that just dev uses.

Signed-off-by: sumit-m <33051892+sumit-m@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-ready Appropriate for agentic review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants