> Recently I wasted several hours wrangling my dev environment only to find out that the browser frontend was talking to the wrong version of the backend.
I have never faced this problem even though I hard-code the port. It's because I run the server program through VS Code's debugger. If there's already a session, it would warn me.