Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change default vite port and add strictport #3427

Closed
wants to merge 1 commit into from

Conversation

atterpac
Copy link
Contributor

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 |


@abichinger
Copy link

abichinger commented Apr 25, 2024

Thank you, that was quick! 👍

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

changelog

Add missing vite.configs
@atterpac
Copy link
Contributor Author

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

Copy link
Member

@leaanthony leaanthony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we test for the env var WAILS_VITE_PORT and default to a hard coded port if unavailable? This means it could be set in the task file with no mismatch.

@leaanthony
Copy link
Member

Closing in favour of #3429

@leaanthony leaanthony closed this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants