npm run tauri dev超时
Warn Waiting for your frontend dev server to start on http://localhost:1420/...
Error Could not connect to `http://localhost:1420/` after 180s. Please make sure that is the URL to your dev server.
网上解决办法一:localhost替换成127.0.0.1
网上解决办法二:vite.config.js
server: {
port: 1420,
strictPort: true,
host: '0.0.0.0', // 增加
hmr: host
? {
protocol: "ws",
host,
port: 1421,
}
: undefined,
watch: {
// 3. tell vite to ignore watching `src-tauri`
ignored: ["**/src-tauri/**"],
},
},
解决办法三:node版本太低
node版本从14.17.3到20.18.0,成功解决