cd /news/ai-tools/your-ai-generated-app-works-locally-… · home › topics › ai-tools › article
[ARTICLE · art-152519] src=dev.to ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Your AI-generated app works locally but not when deployed: 6 checks before you ship

A developer building the Deployka hosting service added a pre-build scan called Deploy Doctor that checks AI-generated projects for common first-deploy blockers, including missing start scripts, hard-coded or 127.0.0.1-bound ports, unlisted environment variables, missing Python dependencies, non-persistent database paths, leaked API keys and Telegram webhook conflicts. The tool targets apps produced by Lovable, Bolt, Cursor and Replit, flagging configuration problems before the build starts.

by read4 min views9 publishedOct 18, 2026

AI tools like Lovable, Bolt, Cursor and Replit can generate a working app in an afternoon. Then you deploy it and it fails in a way that never showed up on your laptop. The code is rarely the problem. The problem is the gap between "runs on my machine" and "runs in a container on someone else's server".

Here are the six checks that catch most first-deploy failures. Each one takes a minute, and each one is a real reason a freshly generated project does not start.

A hosting platform needs to know how to start your app. Generated projects often only have a dev script.

For a Node.js project, check package.json:

{
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "start": "node server.js"
  }
}

If there is no start script, many platforms cannot launch the project. A Vite or Create React App result is a static site, so either serve the built folder or deploy it as static files:

"start": "npx serve -s dist -l $PORT"

For Python, the equivalent is a clear entry point (main.py) and a requirements.txt. For Go, Rust or .NET, expect to need a Dockerfile, because there is no file the platform can guess a build from.

On your laptop, localhost:3000 is fine. In a container, the platform tells you the port through an environment variable, and the app must listen on all interfaces, not only on 127.0.0.1.

// Node / Express
const port = process.env.PORT || 3000;
app.listen(port, "0.0.0.0");

A hard-coded port, or a server bound to 127.0.0.1, looks perfectly healthy in the logs and is unreachable from outside.

Generated code reads secrets from the environment, and your local .env file is not shipped with the project (and should not be). List every variable the code reads:

grep -rnE "process\.env\.[A-Z_]+|os\.environ(\.get)?\(|os\.getenv\(" --include=*.js --include=*.ts --include=*.py .

Two traps are worth knowing:

VITE_ reach the browser, and they are baked in at build time. If the value is missing during the build, the deployed site shows undefined and no error appears anywhere. AI-generated Python code regularly imports packages that never made it into requirements.txt, because the tool installed them in your session. Test in a clean environment before up:

python -m venv /tmp/check && . /tmp/check/bin/activate
pip install -r requirements.txt
python main.py

For Node, run npm ci in a fresh clone. If it fails or the app crashes on a missing module, the deploy would have failed the same way.

Container filesystems are disposable. A SQLite file written to a relative path next to your code can disappear on the next redeploy, and an empty database can silently replace the real one. Put persistent data in the directory your platform keeps across restarts (on Deployka that is /data), and make the path configurable:

import os
DB_PATH = os.environ.get("DB_PATH", "/data/app.db")

AI tools sometimes hard-code a key to make the demo work. Search before you zip or push:

grep -rnE "sk-[A-Za-z0-9]{20,}|BOT_TOKEN\s*=\s*['\"]|api[_-]?key\s*=\s*['\"]" .

If a key was ever committed, rotate it. Deleting it from the latest commit does not remove it from the history.

If a webhook is set for your bot and your code starts long polling, Telegram answers with a conflict error. Either remove the webhook (deleteWebhook) or use webhooks consistently. This is one of the most common "my bot does nothing after deploy" causes.

Running these by hand is fine once. Doing it for every project gets old. That is why I added a pre-build scan, Deploy Doctor, to Deployka, the hosting service I build for Telegram bots, web apps, APIs and AI projects. It looks at your project for the usual blockers (missing environment variables, a missing start command, configuration problems) before the build starts, and it is made with projects from Lovable, Bolt, Cursor and Replit in mind. The scan is free.

If you want to try a deploy without paying, there is a free plan with no card required (128 MB RAM, one project; check the site for current limits). You can upload a ZIP or connect a GitHub repository, add your secrets, and read the logs from the dashboard. Whichever platform you use, the six checks above are worth the minute.

What is the most confusing deploy failure an AI-generated project gave you? I am collecting these for the next checks.

── more in #ai-tools 4 stories · sorted by recency
── more on @deployka 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/your-ai-generated-ap…] indexed:0 read:4min 2026-10-18 · —