Skip to content

fix(desktop): launch Vite through pnpm on Windows - #7164

Open
Aria-iu wants to merge 3 commits into
block:mainfrom
Aria-iu:fix/windows-tauri-pnpm
Open

Aria-iu wants to merge 3 commits into
block:mainfrom
Aria-iu:fix/windows-tauri-pnpm

Conversation

@Aria-iu

@Aria-iu Aria-iu commented Sep 1, 2026

Copy link
Copy Markdown

Summary

Makes every Tauri development entry point launch the project-local Vite binary on Windows without relying on the POSIX-only exec builtin or a hard-coded package-internal JavaScript path.

This consolidates the fixes from #3515 and #3534 while preserving their original authorship, then uses pnpm exec vite for executable resolution. Generated dev configs remain platform-aware: Windows runs pnpm exec vite, while macOS and Linux retain an exec pnpm exec vite handoff so Tauri signals reach the launched command without an extra shell process.

The generated config now uses the same structured beforeDevCommand shape as tauri.conf.json, including its frontend working directory and non-blocking behavior. Non-macOS worktrees also skip the Swift-only development icon generator instead of printing a missing-command warning.

A regression contract covers the checked-in Tauri config, Windows and POSIX generated commands, and the Windows Swift guard. It is wired into the repository policy CI job.

Related issue

Testing

  • scripts/test-desktop-dev-command-contract.sh — passed on Windows 11 / Git Bash
  • bash -n scripts/instance-env.sh — passed
  • bash -n scripts/test-desktop-dev-command-contract.sh — passed
  • pnpm --dir desktop exec vite --versionvite/8.0.16 win32-x64 node-v24.14.0
  • pnpm --dir desktop check — passed (reported existing non-blocking repository warnings)
  • just --dry-run desktop-standalone — expanded successfully
  • git diff --check — passed

No UI is changed, so screenshots do not apply. Full macOS/Linux process-exit behavior was not exercised locally; the existing POSIX exec handoff is retained and the generated command is covered by the contract test.

kiranmagic7 and others added 3 commits September 1, 2026 04:08
Signed-off-by: kiranmagic7 <262980978+kiranmagic7@users.noreply.github.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>
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>
@Aria-iu
Aria-iu requested a review from a team as a code owner September 1, 2026 09:16
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

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

@Aria-iu Aria-iu changed the title fix(dev): launch Vite through pnpm on Windows fix(desktop): launch Vite through pnpm on Windows Sep 1, 2026
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.

3 participants