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

[Bug] dx serve fails with "Address already in use" while port is actually free (MacOS) #3790

Open
weykon opened this issue Feb 23, 2025 · 1 comment
Labels
bug Something isn't working fullstack related to the fullstack crate

Comments

@weykon
Copy link

weykon commented Feb 23, 2025

Environment

  • OS: MacOS
  • Dioxus Version: 0.6.3
  • dx CLI Version: 0.6.3
  • Rust Version: rustc 1.84.1 (e71f9a9a9 2025-01-27)

Issue Description

When running dx serve in a fullstack project, the server fails to start with an "Address already in use" error, even though the port is actually free and can be used by other servers.

Steps to Reproduce

  1. Create a new fullstack Dioxus project
  2. Run dx serve
  3. Get error: Failed to bind to 127.0.0.1:8080: Address already in use (os error 48)

Verification

I verified the port is actually free by:

  1. Running lsof -i :8080 shows no process using the port
  2. Successfully running simple-http-server -i -p 8080 on the same port
  3. The error persists even after:
    • Killing all related processes
    • Using different ports
    • Cleaning project (cargo clean)

Error Output

10:38:30 [server] listening on http://127.0.0.1:8081
10:38:29 [dev] Build completed successfully in 327ms, launching app! 💫
10:38:30 [server] thread 'main' panicked at crates/dx/src/main.rs:21:10:
10:38:30 [server] Failed to build server: Os { code: 48, kind: AddrInUse, message: "Address already in use" }

Additional Context

  • The issue occurs consistently across project restarts
  • Other web servers can successfully bind to the same port
  • No other processes are visibly using the port
  • System permissions appear correct (user owns all relevant directories)
  • The problem persists even with elevated permissions

Attempted Solutions

  1. Used different ports
  2. Cleaned project and cargo cache
  3. Checked and fixed file permissions
  4. Verified network access permissions
  5. Tested with simple-http-server to confirm port availability

Would appreciate any guidance on resolving this issue or what additional information might be helpful.

@weykon weykon added the bug Something isn't working label Feb 23, 2025
@ealmloff
Copy link
Member

If you are targeting dioxus desktop with fullstack, this might be the same issue as #3689 which should be fixed by #3693

@ealmloff ealmloff added the fullstack related to the fullstack crate label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fullstack related to the fullstack crate
Projects
None yet
Development

No branches or pull requests

2 participants