VVibeFix

Guide · Replit

Replit deployment not working: the published app breaks (works in preview)

Updated

When a Replit app works in the workspace but not after you publish, Replit says this is almost always a configuration difference between the environments, such as Secrets set in the editor that do not carry over to the published app. Other documented causes are a server listening on localhost, wrong run or build commands, a static deployment for a full-stack app, and a slow homepage.

Can a stranger actually sign up and get your email? Get it fixed: a free check first confirms the problem on your live app, usually in 4 to 10 minutes.

Free. No account needed. It usually takes 4 to 10 minutes.

Want it fixed? Our AI agent finds the cause, fixes it in your code and re-checks your live app. $79 for one bug, paid up front.

Why it happens

The workspace preview and the published app run separately, with their own settings. Anything the preview gets for free, such as your Secrets, has to be given to the published app too.

The causes, and how to fix each

1. Secrets were set in the editor but not for the published app

Replit says Secrets you set in the Project Editor do not automatically carry over to your published app. Missing Secrets can cause undefined-value errors, failed API calls, database connection failures, login errors or payment failures.

How to fix it

  1. Open the Publishing pane and add every production Secret and environment variable there.
  2. Point values such as the database address at production, not at development.
  3. Publish again so the new values are used.

Source: Replit: Troubleshooting published apps · Replit: Deployment and publishing FAQ

2. The server listens only on localhost

Replit says the server must listen on 0.0.0.0; listening only on localhost or 127.0.0.1 does not work for published apps.

How to fix it

  1. Change the server to listen on 0.0.0.0.
  2. Remove addresses hard-coded to localhost from the app.

Source: Replit: Troubleshooting published apps · Replit: Deployment and publishing FAQ

3. The ports in .replit stop the published app from passing

If your .replit file names ports, automatic port detection is turned off.

How to fix it

  1. In .replit, set externalPort to 80 for the port your app serves.
  2. Make sure the server listens on the localPort you named.

Source: Replit: Troubleshooting published apps

Your AI reads your code. VibeFix signs up like a stranger. Get it fixed: a free check first confirms the problem on your live app, usually in 4 to 10 minutes.

Free. No account needed. It usually takes 4 to 10 minutes.

Want it fixed? Our AI agent finds the cause, fixes it in your code and re-checks your live app. $79 for one bug, paid up front.

4. The run or build command is wrong

Replit lists typos, wrong flags, wrong entry files and commands that only work locally as common mistakes.

How to fix it

  1. Review the build and start commands in the Publishing pane.
  2. Open the Logs tab in the Publishing pane and look for stack traces, missing packages, failed commands, missing environment variables or startup errors.

Source: Replit: Troubleshooting published apps

5. A full-stack app was published as a static deployment

Replit says static deployments have no backend server, so an app with server-side logic or API routes should use Autoscale instead.

How to fix it

  1. Change the deployment type to Autoscale in the Publishing pane.
  2. Publish again.

Source: Replit: Troubleshooting published apps · Replit: Deployment types (Static)

6. The homepage takes more than five seconds to answer

Replit requests your homepage before the app goes live. If it takes more than five seconds, the health check can time out and publishing can fail at the final step.

How to fix it

  1. Reduce the work done at startup, move slow work behind a user action, or cache data where it makes sense.
  2. Publish again.

Source: Replit: Troubleshooting published apps · Replit: Deployment and publishing FAQ

Why you can't see it yourself

You're signed in, your customers aren't. The workspace preview uses your Secrets and a friendly setup. The public address starts from what you gave the published app, and only visitors to it meet what is missing.

Frequently asked questions

Why does my Replit app work in the editor but not when published?

The two environments have separate settings. Replit says Secrets set in the editor do not carry over; add them in the Publishing pane, point the database at production and remove localhost addresses.

I updated a Secret but the published app does not see it. Why?

Changing one environment does not change the other. Set the value for the published app in the Publishing pane, then publish again.

Why did publishing fail at the last step?

Replit checks your homepage before going live. If it takes more than five seconds to respond, the health check can time out.

Where are the logs for my published Replit app?

In the Logs tab of the Publishing pane.

Which deployment type should a web app with a server use?

Not Static, which serves only HTML, CSS and JavaScript. Replit's troubleshooting says to change the type to Autoscale in the Publishing pane.

Can VibeFix fix it for me?

Yes, if you ask. The free check confirms the problem first. Our AI agent can find the cause, fix it in your code and re-check your live app: $79 for one bug, paid up front. If we can't complete your re-check, you get your money back.

Sources (official documentation)

Related guides

VibeFix is independent. Replit are trademarks of their owners.

Fixed it? Prove a real stranger gets in

A fix that works from your own account proves nothing about a new customer. Your AI reads your code. VibeFix signs up like a stranger.

Free check. Paste your live app's link: an AI agent signs up to your live app once as a brand-new person ("VibeFix Test") with a real inbox of its own, on a phone and on a computer, and shows how many problems a new user still hits, what each one is, and one screenshot. No account needed. It never changes your app and never emails your users.

Check my live app, free

Want it fixed?

Our AI agent finds the cause, fixes it in your code and re-checks your live app. $79 for one bug, paid up front. If we can't complete your re-check, you get your money back.

It starts with a free check that confirms the problem on your live app, no account needed.

Get it fixed — free check first

More guides