wails
wails copied to clipboard
Getting this Error on `wails dev`: "Error: failed to find Vite server URL" and dev windows not opening
Description
I've been getting this error for the last few days. It used to be fine and would open a new window that would instantly show the changes I made in the frontend. But now when I run wails dev
, it throws the following error:
DEB | Using go webview2loader
Wails CLI v2.6.0
Executing: go mod tidy
• Installing frontend dependencies: Done.
• Compiling frontend: Done.
ERROR failed to find Vite server URL
To Reproduce
wails dev
Expected behaviour
It should open a windows (just like before) and should reflect any changes I made to the frontend.
Screenshots
No response
Attempted Fixes
- I looked up the issue and saw that someone had suggested changing the
frontend:dev:serverUrl
and I changed"frontend:dev:serverUrl": "auto"
in the wails.json file to a localhost url but it still didn't work. (This issue and the suggested solutions didn't work either: https://github.com/wailsapp/wails/issues/1611) - I reinstalled Vite and wails and started from scratch... but to no avail
System Details
E:\pass_manager_wails>wails doctor
DEB | Using go webview2loader
Wails Doctor
# Wails
Version | v2.6.0
# System
┌────────────────────────────────────┐
| OS | Windows 10 Pro |
| Version | 2009 (Build: 19045) |
| ID | 22H2 |
| Go Version | go1.21.2 |
| Platform | windows |
| Architecture | amd64 |
└────────────────────────────────────┘
# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status | Version |
| WebView2 | N/A | Installed | 119.0.2151.97 |
| Nodejs | N/A | Installed | 18.18.1 |
| npm | N/A | Installed | 9.8.1 |
| *upx | N/A | Available | |
| *nsis | N/A | Available | |
└─────────────── * - Optional Dependency ───────────────┘
# Diagnosis
Optional package(s) installation details:
- upx : Available at https://upx.github.io/
- nsis : More info at https://wails.io/docs/guides/windows-installer/
SUCCESS Your system is ready for Wails development!
♥ If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
Additional context
No response
If you run Vite outside of Wails what url does it listen on?
Wails CLI v2.6.0
Executing: go mod tidy • Generating bindings: Done. • Installing frontend dependencies: Done. • Compiling frontend: Done.
[email protected] dev vue-cli-service serve
INFO Starting development server... [92%] sealing (asset processing SourceMapDevToolPlugin)
ERROR failed to find Vite server URL
♥ If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony
node:events:491
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at afterWriteDispatched (node:internal/stream_base_commons:160:15)
at writeGeneric (node:internal/stream_base_commons:151:3)
at Socket._writeGeneric (node:net:905:11)
at Socket._write (node:net:917:8)
at writeOrBuffer (node:internal/streams/writable:391:12)
at _write (node:internal/streams/writable:332:10)
at Socket.Writable.write (node:internal/streams/writable:336:10)
at render (/Users/lvluo/Desktop/github.com/js+ui/test-gui/frontend/node_modules/.pnpm/[email protected]/node_modules/log-update/index.js:40:10)
at handler (/Users/lvluo/Desktop/github.com/js+ui/test-gui/frontend/node_modules/.pnpm/[email protected][email protected]/node_modules/progress-webpack-plugin/index.js:117:7)
at Object.call (/Users/lvluo/Desktop/github.com/js+ui/test-gui/frontend/node_modules/.pnpm/[email protected]/node_modules/webpack/lib/ProgressPlugin.js:507:6)
at Hook.eval [as callAsync] (eval at create (/Users/lvluo/Desktop/github.com/js+ui/test-gui/frontend/node_modules/.pnpm/[email protected]/node_modules/tapable/lib/HookCodeFactory.js:33:10),
cd frontend using npm run dev is normal.
If you run Vite outside of Wails what url does it listen on?
In the frontend dir in the wails app, the url is http://localhost:5173/
cd frontend using npm run dev is normal.
Yes, but why isn't wails dev
throwing that error? I want to get the wails dev
command to work but I don't know why it's causing that issue.
Looks like a node compatibility issue. Try +1 and -1 versions via nvm