Replit App Not Working? What to Check Before Starting Again
If a Replit app is not working, check preview, logs, packages, secrets, database, auth, routes and deployment before rebuilding.
If your Replit app is not working, resist the urge to ask Replit Agent or another AI tool to rewrite the whole project straight away. A Replit app can fail in several different places: the preview may not load, the deployed version may behave differently, the backend may not start, the database may reject a connection, auth may loop, or the interface may load but not respond. Those are different problems with different repair paths.
The useful first step is not to guess. It is to separate the symptom from the cause. A visible broken page might be caused by frontend code, but it might also be caused by a missing secret, a server process that never started, a failed API response or a route that only breaks after deployment. Treat the app like a system with layers, not one single block of generated code.
For hands-on diagnosis, see Replit app repair.
Start by naming the failing layer
Write down exactly where the app fails. Does the Replit preview fail before you see anything? Does the live deployment return a blank page? Does one route work while another returns 404? Does login work in preview but fail on the deployed domain? Does a form submit but never save to the database? Those details matter because they tell you which layer to check first.
If preview is broken, start with server output, package install messages and browser console errors. If preview works but deployment fails, start with deployment logs, production secrets, start commands, domains and runtime errors. If only database or login features fail, start with environment variables, connection strings, callback URLs, permissions and session handling. A good repair starts by narrowing the field.
Why the first error matters
When an app breaks, the console or logs may show a long list of errors. The last error is not always the important one. Later errors often happen because the first failure stopped part of the app from loading. For example, a missing package can create a module error, which then creates undefined values, which then breaks a route and causes several unrelated-looking warnings.
Read from the top of the log or console and look for the first specific failure. That might be a missing module, a refused connection, an undefined environment variable, a port conflict, a failed fetch, a CORS problem or a database permission error. If you feed an AI tool only the final warning, it may patch a symptom and leave the real problem untouched.
Separate preview, deployment and runtime behaviour
A Replit workspace preview is not the same as a production deployment. Preview may run with a different command, different environment values, different URLs and a different lifecycle. The deployed app may need its own secrets, domains, callback URLs and server startup behaviour. That is why an app can look finished in preview and still fail when shared with users.
Compare the same action in both places. Open the same route, click the same button and test the same login or database action. If preview works and live fails, do not rewrite the working feature yet. Check the difference between the environments first. If both fail in the same way, the issue is more likely to be code, dependencies, app structure or a connected service.
Check backend, database, auth and UI symptoms separately
A backend failure can look like a UI failure. A login failure can look like a broken route. A database permission issue can look like an empty dashboard. A missing API key can look like a blank screen. The symptom users see is only the final result.
For backend issues, check whether the server starts, which command is running and which port it listens on. For database issues, check the connection string, schema, permissions and any migrations the generated code expects. For auth issues, check callback URLs, redirect domains, cookies and session persistence. For UI issues, check browser console errors, missing imports, component state and responsive behaviour.

Why broad fix prompts are risky
A broad prompt such as “fix everything” can make a repair harder. It may rewrite files that were already working, change package versions, move routes, rename variables, alter auth logic or hide the original failure under a new layer of changes. The app might appear different afterwards, but not necessarily more stable.
A better prompt is narrow and evidence-led: name the first error, the route or command involved, what changed recently and what should not be rewritten. Ask for the smallest change that addresses the specific fault. If the AI tool proposes a large refactor before the cause is clear, pause and get the app diagnosed.
When generated code repair is enough
Generated code repair is usually enough when the fault is inside the app code itself: a broken import, a component using the wrong prop, a route guard that redirects too early, a fetch call pointing to the wrong endpoint, or server code that handles a request incorrectly. In those cases, AI code repair can stabilise the faulty logic without rebuilding the whole project.
Configuration or deployment work is needed when the code is mostly sound but the environment is wrong. Missing secrets, wrong start commands, incorrect ports, callback URLs, production domains, database access and hosting settings all sit outside normal code repair. That is why diagnosis matters before deciding who or what should fix it.
When to stop prompting and get help
Stop prompting when each attempted fix creates a new error, when you no longer know which files changed, when the live app is needed for a client or customer, or when the issue involves auth, payments, private data or production database access. At that point, more prompts can cost more than a focused diagnosis.
If you are unsure which layer is failing, use root cause diagnosis before changing more code. If the app is live and a failure is blocking a launch or customer journey, emergency website fixes may be the right route.
Practical checklist
- Confirm whether preview, deployment or both are failing.
- Capture the first meaningful console or log error.
- Check the run command, start command and port behaviour.
- Check package install errors and missing imports.
- Check secrets and environment variable names.
- Test database and auth features separately from the UI.
- Compare preview and deployed behaviour on the same route.
- Avoid broad prompts that rewrite unrelated files.
- Record recent changes before asking for another fix.
Conclusion
A Replit app that is not working is not automatically a failed build. It is a debugging problem. Separate the symptom, find the failing layer, read the first error and then choose between code repair, configuration repair or deployment support.