Error fixes / Replit

Replit

Replit: Application failed to respond

The published app is not listening on the port Replit expects.

The error

Application failed to respond

What it means

Replit's help page says this message means the process is not listening on the port they pass in. The PORT environment variable is the port to bind. The server also has to listen on 0.0.0.0. Listening only on 127.0.0.1 or localhost works in a private preview and fails once the app is published. Their troubleshooting note says the same thing: deployments need 0.0.0.0, and a ports block in .replit turns off automatic detection.

Fix

  1. Find the listen call. Bind the host to 0.0.0.0 and the port to process.env.PORT, with a local default.
  2. If .replit has a ports table, set localPort to that same port and externalPort to 80 for the public app. Remove extra public ports if you only have one web server.
  3. Open the deployment logs. A crash before listen looks the same from outside. Fix the exception first if the process is exiting.
  4. Publish again after the change. The development preview and the published app do not always share a command.
  5. Load the published URL from a phone, not only the Replit webview.

Prompt

Fix prompt
Paste into Cursor or Claude Code
The published Replit app says "Application failed to respond".

Bind the server to 0.0.0.0 and to the PORT environment variable. If .replit configures ports, make localPort match and keep a single externalPort of 80 unless I say otherwise. Check the run command actually starts this server. Do not deploy it yourself. Show me the listen call and the config you changed.

Questions

The app works when I press Run. Why does the published URL fail?

Run uses the workspace. Publishing starts the deployment command, which may be different, and it will not accept a server bound only to localhost.

Should I hard-code port 3000?

Use PORT when it is set, and 3000 only as a local default. Replit tells you the port for a reason. A hard-coded port is a common cause of this message.

The logs say the process exited. Is that the same bug?

The public message can look the same, but an exit is a crash. Read the exception in the deployment log and fix that before you change ports.

Related fixes

Source: Replit docs: Networking and app errors. Updated 14 October 2026.