wails icon indicating copy to clipboard operation
wails copied to clipboard

[Windows 11] wails dev fails to bind to port 34115

Open doteich opened this issue 2 years ago • 3 comments

Description

I am not able to open the dev server on port 34115 (build works just fine). Using Curl/Test Net Connection tells me, that nothing on that port is running, so i am only able to reach the default vue.js dev server for the frontend on localhost:5173. I also tried to set a different URL via wails.json or the command line flag. From the console, everything looks fine and I dont see any errors.

PS E:\wails\test> wails dev
DEB | Using go webview2loader
Wails CLI v2.6.0

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

> [email protected] dev
> vite


  VITE v3.2.7  ready in 232 ms

Vite Server URL: http://localhost:5173/
  ➜  Local:   http://localhost:5173/
Running frontend DevWatcher command: 'npm run dev'
  ➜  Network: use --host to expose
Building application for development...
  • Generating bindings: Done.
  • Generating application assets: Done.
  • Compiling application: Done.
 INFO  Wails is now using the new Go WebView2Loader. If you encounter any issues with it, please report them to https://github.com/wailsapp/wails/issues/2004. You could also use the old legacy loader with `-tags native_webview2loader`, but keep in mind this will be deprecated in the near future.

Using DevServer URL: http://localhost:34115
Using Frontend DevServer URL: http://localhost:5173/
Using reload debounce setting of 100 milliseconds
Watching (sub)/directory: E:\wails\test
DEB | Using go webview2loader


To develop in the browser and call your bound Go methods from Javascript, navigate to: http://localhost:34115

To Reproduce

  1. wails init -n test -t vue
  2. cd test
  3. wails dev
  4. tnc localhost -p 34115 > TcpTestSucceeded: False

Expected behaviour

Wails dev binds successfully to port 34115

Screenshots

No response

Attempted Fixes

  • Tried to bind server URL to a different port/URL
  • Tried to set a different URL via CLI command
  • Disabled Firewall

System Details

# Wails
Version | v2.6.0

# System
┌──────────────────────────────────────┐
| OS           | Windows 10 Enterprise |
| Version      | 2009 (Build: 22621)   |
| ID           | 22H2                  |
| Go Version   | go1.21.3              |
| Platform     | windows               |
| Architecture | 386                   |
└──────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 119.0.2151.44 |
| Nodejs     | N/A          | Installed | 21.1.0        |
| npm        | N/A          | Installed | 10.2.0        |
| *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!

Additional context

No response

doteich avatar Nov 05 '23 15:11 doteich

Hi,

Are you saying that you can access the webpage via http://localhost:34115 but running curl requests for the same is unsuccessful?

PylotLight avatar Nov 05 '23 22:11 PylotLight

Hi, its actually both. I can't access the webpage and curl returns unsuccessful. To check if it is some issue with the port, I also ran a quick http-server http.ListenAndServe("localhost:34115",nil), which worked just fine.

doteich avatar Nov 06 '23 08:11 doteich

Hey,

Unfortunately, that repro is working fine for me with no issues, so my current guess is some sort of issue with your environment or setup. This is a windows installation it looks like, has this ever worked before? Does this do anything for you? wails dev -devserver localhost:34117 https://wails.io/docs/reference/cli/#dev

PylotLight avatar Nov 06 '23 10:11 PylotLight

I'm experiencing exactly the same behavior but with Mac M2. Also tested wails dev -devserver localhost:34117 but no luck. Below is the details:

wails dev -devserver localhost:34117
Wails CLI v2.7.1

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

> [email protected] dev
> vite


  VITE v3.2.7  ready in 184 ms

Vite Server URL: http://localhost:5173/
  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
Running frontend DevWatcher command: 'npm run dev'
Building application for development...
  • Generating bindings: Done.
  • Compiling application: Done.
  • Packaging application: Done.
 WARNING  This darwin build contains the use of private APIs. This will not pass Apple's AppStore approval process. Please use it only as a test build for testing and debug purposes.

Using DevServer URL: http://localhost:34117
Using Frontend DevServer URL: http://localhost:5173/
Using reload debounce setting of 100 milliseconds

repro:

wails init -n myproject -t react-ts
cd test
wails dev
access http://localhost:34117
image

masato-io avatar Dec 31 '23 05:12 masato-io

Just FYI, not sure if that was the root cause, but using these deps via rtx seems to have fixed my issue:

  • go 1.19
  • node 18.19.0

masato-io avatar Dec 31 '23 07:12 masato-io

Hi all, rookie mistake from my side. Issue was, that I had the Go installed for Arch "386" while it should have been "AMD64". Recently updated to a newer go version and it works now.

doteich avatar Apr 14 '24 15:04 doteich