[V3 Bugs] Developing on two projects simultaneously, since their frontend URLs are fixed, will lead to accessing the wrong page
Description
Wails 3 uses localhost:5173 as the fixed URL. When I open two Wails projects, both projects will direct to the same page.
To Reproduce
- Change directory to wails3_project_A.
- Run
wails3 dev. (frontend listen on localhost:5173) - Change directory to wails3_project_B.
- Run
wails3 dev. (frontend listen on localhost:5174) - A: Show the page belonging to project A. (connect to localhost:5173)
- B: Show the page belonging to project A. (connect to localhost:5173)
Expected behaviour
A: Show the page belonging to project A. (connect to localhost:5173) B: Show the page belonging to project B. (connect to localhost:5174)
Screenshots
No response
Attempted Fixes
No response
System Details
Wails Doctor
# System
┌──────────────────────────────┐
| Name | MacOS |
| Version | 14.4.1 |
| ID | 23E224 |
| Branding | Sonoma |
| Platform | darwin |
| Architecture | arm64 |
| Apple Silicon | true |
| CPU | Apple M1 Pro |
| CPU | Unknown |
| GPU | Unknown |
| Memory | Unknown |
└──────────────────────────────┘
# Build Environment
┌─────────────────────────────────────────────────────────┐
| Wails CLI | v3.0.0-alpha.4 |
| Go Version | go1.22.1 |
| Revision | cf130a6e2564426b2ab222598cd452e68e8a62bd |
| Modified | false |
| -buildmode | exe |
| -compiler | gc |
| CGO_CFLAGS | |
| CGO_CPPFLAGS | |
| CGO_CXXFLAGS | |
| CGO_ENABLED | 1 |
| CGO_LDFLAGS | |
| GOARCH | arm64 |
| GOOS | darwin |
| vcs | git |
| vcs.modified | false |
| vcs.revision | cf130a6e2564426b2ab222598cd452e68e8a62bd |
| vcs.time | 2024-04-06T03:38:43Z |
└─────────────────────────────────────────────────────────┘
# Dependencies
┌────────────────────────────────────────────────────────────────────────┐
| Xcode cli tools | 2406 |
| npm | 10.2.4 |
| *NSIS | Not Installed. Install with `brew install makensis`. |
└─────────────────────── * - Optional Dependency ────────────────────────┘
# Diagnosis
SUCCESS Your system is ready for Wails development!
Additional context
No response
If possible, I would like to try to fix it. Do you have any suggestions for this bug?
It uses whatever url you give it: FRONTEND_DEVSERVER_URL: 'http://localhost:5173'
https://github.com/wailsapp/wails/blob/cf130a6e2564426b2ab222598cd452e68e8a62bd/v3/internal/templates/_common/Taskfile.tmpl.yml#L438
Wails cannot detect the correct frontend port. For example, I opened a project running on port 5173. When running the Wails project, the frontend port will run on 5174. However, the backend still connects to port 5173.
Can wails support the dynamic port?
It will be better than vite can read this env FRONTEND_DEVSERVER_URL: 'http://localhost:5175' to set the frontend port.