Guide · Replit
My Replit app works in the workspace but not once it's published
In Replit's Preview the app works. At the public address it fails to start, shows errors, or loses logins, data or payments.
Find out in 2 minutes which of these is breaking your app. Test my app, free
Why it happens
Preview and the published app are two different environments. Replit's own troubleshooting page says Secrets set in the Project Editor do not automatically carry over to the published app.
Possible causes
- Secrets and environment variables were set in the editor but not for the published app, which causes undefined values, failed API calls, database connection failures, login errors or payment failures.
- The server listens only on the local machine address, which does not work for published apps.
- An app with server-side behavior was deployed as a Static deployment.
- The run or build command is wrong: a typo, a wrong entry file, or a command that only works locally.
- The program runs once and exits instead of staying running as a server.
- Ports are specified in the app's config, which switches off automatic port detection.
- The homepage takes more than five seconds to respond, so the health check times out at the last step of publishing.
- Login callbacks, payment redirects or allowed-origin settings still point at the development address.
You can't see it yourself
You're signed in, your customers aren't. Preview uses your secrets and a friendly setup. The public address starts from scratch, and only visitors to it meet what is missing.
Find out in 2 minutes which of these is breaking your app. Test my app, free
Related: It works in the preview but breaks after I deploy · My app shows a blank white page after publishing · My app is stuck on a loading spinner after I publish it
VibeFix is independent. Lovable, Bolt, Replit, Base44, v0, Supabase, Clerk and Vercel are trademarks of their owners.
Still stuck?
Paste your app’s link for a free sign-up check, no account needed. An AI agent signs up to your live app as a brand-new person, on a phone and a computer, and tells you whether a new person can finish.