watchexec/cargo-watch

Cargo watch hangs when I save my project

santiagomed opened this issue · 3 comments

I am running an Actix project using cargo-watch. The command I use through a script is RUST_LOG=$LOG_LEVEL cargo watch -x run -p server. It had been working perfectly for some time, however recently it stopped working. Now whenever I save one of my files it shows [Running 'cargo run'] and it just hangs there. Pressing Ctrl-C does not seem to stop the program. Additionally, whenever I close the terminal and re-run the command it gives me the following message:

Error: Os { code: 48, kind: AddrInUse, message: "Address already in use" }
[Finished running. Exit status: 1]

I have to run lsof -ti tcp:8080 | xargs kill -9 in order for it to work again. Anyone have any ideas what might be causing this?

  • How recently?
  • What's your version? Does it work with an older version?
  • What's your OS?
  • Please run with --debug and provide a log

@santiagomed I had the same issue after a rustup update on macOS. I updated cargo-watch from v8.3.0 to v8.4.0 and now it works again.

Thanks for your feedback @BenoitZugmeyer :)

@santiagomed given I haven't heard from you in a week I'm closing this as lacking info.