wails icon indicating copy to clipboard operation
wails copied to clipboard

change default vite port and add strictport

Open atterpac opened this issue 1 year ago • 2 comments
trafficstars

Description

Commit changes the default vite port to :9245 to help avoid conflicts when users are already running something on the default vite port. Also sets vite port to strict so vite will error if this port is not available.

Adjusted taskfile to match port

Fixes # (issue)

Type of change

  • [ X ] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • [ X ] Linux

Test Configuration

# System

| Name         | Ubuntu                             |
| Version      | 22.04                              |
| ID           | ubuntu                             |
| Branding     | 22.04.3 LTS (Jammy Jellyfish)      |
| Platform     | linux                              |
| Architecture | amd64                              |
| CPU          | AMD Ryzen 7 3700X 8-Core Processor |
| GPU 1        | Unknown                            |
| Memory       | 12GB                               |


# Build Environment

| Wails CLI      | v3.0.0-alpha.4                                                                 |
| Go Version     | go1.22.0                                                                       |
| Revision       | 5d0a58cc6ada0626f25d09eceeca3946181ab7ef                                       |
| Modified       | true                                                                           |
| -buildmode     | exe                                                                            |
| -compiler      | gc                                                                             |
| CGO_CFLAGS     |                                                                                |
| CGO_CPPFLAGS   |                                                                                |
| CGO_CXXFLAGS   |                                                                                |
| CGO_ENABLED    | 1                                                                              |
| CGO_LDFLAGS    |                                                                                |
| DefaultGODEBUG | httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1 |
| GOAMD64        | v1                                                                             |
| GOARCH         | amd64                                                                          |
| GOOS           | linux                                                                          |
| vcs            | git                                                                            |
| vcs.modified   | true                                                                           |
| vcs.revision   | 5d0a58cc6ada0626f25d09eceeca3946181ab7ef                                       |
| vcs.time       | 2024-04-25T05:59:33Z                                                           |


# Dependencies

| npm        | 10.5.0                  |
| pkg-config | 0.29.2-1ubuntu3         |
| gcc        | 12.9ubuntu3             |
| libgtk-3   | 3.24.33-1ubuntu2        |
| libwebkit  | 2.44.0-0ubuntu0.22.04.1 |


atterpac avatar Apr 25 '24 16:04 atterpac

Thank you, that was quick! :+1:

Some templates (e.g. vanilla) still use the port 5173, because they have no vite.config.js

$ wails3 init -t vanilla -n myapp
$ cd myapp
$ wails3 dev
...

  VITE v5.2.10  ready in 137 ms

  ➜  Local:   http://localhost:5173/
...
7:41PM INF Retrying...
7:41PM INF Retrying...
7:41PM INF Retrying...
7:41PM ERR A FATAL ERROR HAS OCCURRED: unable to connect to frontend server. Please check it is running FRONTEND_DEVSERVER_URL=http://localhost:9245
  ERROR   task: Failed to run task "run": exit status 1

abichinger avatar Apr 25 '24 17:04 abichinger

Some templates (e.g. vanilla) still use the port 5173, because they have no vite.config.js

Good catch those vite configs should be added now

atterpac avatar Apr 25 '24 18:04 atterpac

Closing in favour of https://github.com/wailsapp/wails/pull/3429

leaanthony avatar May 02 '24 11:05 leaanthony