Opening second port leads to HARD crash

Problem description:
Replit now crashes without any errors printed when a port is opened on an undefined port.

This caused me to spend over 3 hours debugging a testing issue, where my tests were exposing port 8099 but my .replit config was set for the dev server at port 3000.

Sometimes it’s not possible to know what port your tools are going to use, sometimes it’s dynamically exposed to localhost based on availability. In that case the port forwarding feature would not work or be unreliable. I often would prefer if localhost were not exposed to the public by default. As many tools expose debugging HTTP pages that I would rather not be made public, as it would compromise secrets and files, even on private Replit’s.

Expected behavior:
No crashes. Or at the very least provide a message on why it crashed.

Actual behavior:
Hard crash, no errors.

Steps to reproduce:

  1. Configure a port to forward to port 80
  2. Open another port

Bug appears at this link:
https://replit.com/@fossprime/Bug-Bad-Port-Hard-Crash

1 Like

See our documentation on configuring with port should be exposed:

https://docs.replit.com/programming-ide/configuring-repl#ports

2 Likes

For me, I don’t get a crash but it won’t let me bind to the port.

3 Likes

It’s been fixed! Before it would restart the container. As if we had changed the configuration or ran kill 1

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.