wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.25k stars 1.22k forks source link

Getting this Error on `wails dev`: "Error: failed to find Vite server URL" and dev windows not opening #3092

Open riyanswat opened 11 months ago

riyanswat commented 11 months ago

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

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

leaanthony commented 11 months ago

If you run Vite outside of Wails what url does it listen on?

ctfang commented 11 months ago

Wails CLI v2.6.0

Executing: go mod tidy • Generating bindings: Done. • Installing frontend dependencies: Done. • Compiling frontend: Done.

v3-admin@3.1.3 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/log-update@2.3.0/node_modules/log-update/index.js:40:10) at handler (/Users/lvluo/Desktop/github.com/js+ui/test-gui/frontend/node_modules/.pnpm/progress-webpack-plugin@1.0.12_webpack@5.70.0/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/webpack@5.70.0/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/tapable@2.2.1/node_modules/tapable/lib/HookCodeFactory.js:33:10), :8:18) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/lvluo/Desktop/github.com/js+ui/test-gui/frontend/node_modules/.pnpm/tapable@2.2.1/node_modules/tapable/lib/Hook.js:18:14) at Compiler.emitAssets (/Users/lvluo/Desktop/github.com/js+ui/test-gui/frontend/node_modules/.pnpm/webpack@5.70.0/node_modules/webpack/lib/Compiler.js:878:19) at /Users/lvluo/Desktop/github.com/js+ui/test-gui/frontend/node_modules/.pnpm/webpack@5.70.0/node_modules/webpack/lib/Watching.js:181:21 at processTicksAndRejections (node:internal/process/task_queues:78:11) Emitted 'error' event on Socket instance at: at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) { errno: -32, code: 'EPIPE', syscall: 'write' }

ctfang commented 11 months ago

cd frontend using npm run dev is normal.

riyanswat commented 11 months ago

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/

riyanswat commented 11 months ago

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.

leaanthony commented 11 months ago

Looks like a node compatibility issue. Try +1 and -1 versions via nvm