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

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.

@cameronhotchkies cameronhotchkies added the triage-ready Appropriate for agentic review label Jul 30, 2026
@sumit-m
sumit-m force-pushed the windows-dev-launch branch from 9b10dd4 to b2f878c Compare July 31, 2026 20:03
@sumit-m
sumit-m force-pushed the windows-dev-launch branch from b2f878c to 40be996 Compare August 6, 2026 03:11
Aria-iu added a commit to Aria-iu/buzz-Mee that referenced this pull request Sep 11, 2026
Use pnpm's project-local executable resolution instead of coupling the Tauri
dev command to Vite's internal JavaScript entry point. Preserve the POSIX
exec handoff outside Windows, skip the macOS icon generator elsewhere, and
cover both generated command variants with a CI contract test.

Builds on the platform handling from block#3515 and block#3534.

Signed-off-by: Aria-iu <2357648739@qq.com>
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>
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 4cd82f513214aad11c2b742ce7cc7c681e8e32a0...22749afbc4ff9f9ffb6fb71720de12567cd77be0.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 22749afbc4ff9f9ffb6fb71720de12567cd77be0 to authorize a new review.
Any previous review applies only to its recorded range.

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