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

Air rebuilds the application without freeing the port. #683

Open
nzrsh opened this issue Nov 10, 2024 · 5 comments
Open

Air rebuilds the application without freeing the port. #683

nzrsh opened this issue Nov 10, 2024 · 5 comments
Assignees
Labels

Comments

@nzrsh
Copy link

nzrsh commented Nov 10, 2024

I apologize in advance, my question may seem stupid, but I don't know how to deal with the problem. I have just recently started programming in GO and I am interested in Air. I am developing a server using the Fiber framework. While making changes to the application, Air tries to rebuild the application, but an error is thrown because the port is already busy.
For example the application was running on port 3000 and during the rebuild an error is thrown:
panic: failed to listen: listen tcp4 :3000: bind: Only one usage of each socket address (protocol/network address/port) is normally allowed.

Setting the build delay to 10 seconds or more does not help.

@istyf
Copy link
Contributor

istyf commented Nov 10, 2024

Don’t worry. Your question is not stupid at all.

I have encountered the same issue and submitted a fix for it. I hope that the maintainers will have the time to accept or provide feedback on PR #670 soon.

@hanwenbo
Copy link

+1

@hanwenbo
Copy link

This library has a bug, it can only be used this way, otherwise it will keep repeating the port
I looked it up online and it's been a bug for years

lsof -ti tcp:8000 | xargs kill -9; make dev

@istyf
Copy link
Contributor

istyf commented Nov 11, 2024

This library has a bug, it can only be used this way, otherwise it will keep repeating the port I looked it up online and it's been a bug for years

lsof -ti tcp:8000 | xargs kill -9; make dev

OP uses port 3000. But yes, as things currently are, air might require frequent manual killing of processes for some users.

@gregawoods
Copy link

+1. I ran into this issue back in May and eventually gave up using Air.

@xiantang xiantang added the bug label Dec 18, 2024
@xiantang xiantang self-assigned this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants