cargo运行报错: Warn Waiting for your frontend dev server to start on http://localhost:5173/... 说明连不上前端服务,检查vite.config.js
// tauri expects a fixed port, fail if that port is not available
server: {
port: 1420, // 查看port端口
strictPort: true,
host: host || false,
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
: undefined,
watch: {
// 3. tell Vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
}));
tauri寻找的是5173端口而vite启动的1420端口,注释server即可,会启动默认5173端口