Windows dev build: Tauri version mismatch, IPv6 localhost timeout, and Vite watching Cargo target
Environment
- Windows 11
- Node.js 24.16.0
- npm 11.13.0
- Rust 1.97.0
- Visual Studio Build Tools 2022
- FileExplorer 0.2.3, current
main
Problem
A fresh Windows checkout could not be started with:
npm install
npm run tauri dev
I encountered three consecutive issues.
1. Tauri dialog plugin version mismatch
The initial run failed with:
Error Found version mismatched Tauri packages:
tauri-plugin-dialog (v2.0.0-rc) :
@tauri-apps/plugin-dialog (v2.7.1)
Updating the Rust dependency fixed it:
cargo add --manifest-path .\src-tauri\Cargo.toml tauri-plugin-dialog@2.7.1
Suggested change in src-tauri/Cargo.toml:
tauri-plugin-dialog = "2.7.1"
2. Tauri waits indefinitely for the Vite server on Windows
Vite reported:
Local: http://localhost:1420/
but Tauri repeatedly printed:
Waiting for your frontend dev server to start on http://localhost:1420/...
netstat showed that Vite was listening only on IPv6:
while 127.0.0.1:1420 was unavailable.
The following changes fixed it:
In vite.config.js:
host: host || "127.0.0.1",
In src-tauri/tauri.conf.json:
"devUrl": "http://127.0.0.1:1420"
3. Vite watches the Cargo target directory
During Rust compilation, Vite terminated with:
Error: EBUSY: resource busy or locked, watch
'C:\Users\...\FileExplorer\target\debug\build\serde-...\build_script_build-....exe'
The existing Vite exclusion ignores only src-tauri, but Cargo places its target directory at the repository root in this setup.
Adding the Cargo target directory to the ignored paths fixed the problem:
watch: {
ignored: ["**/src-tauri/**", "**/target/**"],
},
Additional Windows prerequisite
Because ssh2 enables vendored-openssl, the build also requires Perl:
configuring OpenSSL build: Command 'perl' not found
Installing Strawberry Perl resolved this. It may be useful to mention Perl in the Windows build prerequisites.
Result
After these changes and installing Perl, npm run tauri dev compiled successfully and launched the application.
Windows dev build: Tauri version mismatch, IPv6 localhost timeout, and Vite watching Cargo target
Environment
mainProblem
A fresh Windows checkout could not be started with:
I encountered three consecutive issues.
1. Tauri dialog plugin version mismatch
The initial run failed with:
Updating the Rust dependency fixed it:
Suggested change in
src-tauri/Cargo.toml:2. Tauri waits indefinitely for the Vite server on Windows
Vite reported:
but Tauri repeatedly printed:
netstatshowed that Vite was listening only on IPv6:while
127.0.0.1:1420was unavailable.The following changes fixed it:
In
vite.config.js:In
src-tauri/tauri.conf.json:3. Vite watches the Cargo target directory
During Rust compilation, Vite terminated with:
The existing Vite exclusion ignores only
src-tauri, but Cargo places its target directory at the repository root in this setup.Adding the Cargo target directory to the ignored paths fixed the problem:
Additional Windows prerequisite
Because
ssh2enablesvendored-openssl, the build also requires Perl:Installing Strawberry Perl resolved this. It may be useful to mention Perl in the Windows build prerequisites.
Result
After these changes and installing Perl,
npm run tauri devcompiled successfully and launched the application.