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

[V3 Bugs] Developing on two projects simultaneously, since their frontend URLs are fixed, will lead to accessing the wrong page #3379

Open
fakecore opened this issue Apr 7, 2024 · 5 comments
Labels
Bug Something isn't working

Comments

@fakecore
Copy link

fakecore commented Apr 7, 2024

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

  1. Change directory to wails3_project_A.
  2. Run wails3 dev. (frontend listen on localhost:5173)
  3. Change directory to wails3_project_B.
  4. Run wails3 dev. (frontend listen on localhost:5174)
  5. A: Show the page belonging to project A. (connect to localhost:5173)
  6. 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

@fakecore fakecore added the Bug Something isn't working label Apr 7, 2024
@fakecore
Copy link
Author

fakecore commented Apr 7, 2024

If possible, I would like to try to fix it. Do you have any suggestions for this bug?

@leaanthony
Copy link
Member

It uses whatever url you give it: FRONTEND_DEVSERVER_URL: 'http://localhost:5173'

FRONTEND_DEVSERVER_URL: 'http://localhost:5173'

@fakecore
Copy link
Author

fakecore commented Apr 8, 2024

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.

@fakecore
Copy link
Author

fakecore commented Apr 8, 2024

Can wails support the dynamic port?

@fakecore
Copy link
Author

fakecore commented Apr 8, 2024

It will be better than vite can read this env FRONTEND_DEVSERVER_URL: 'http://localhost:5175' to set the frontend port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants