Troubleshooting
Diagnose installation, GitHub, Git, startup, database, environment variable, build, networking, DNS and HTTPS problems.
Most problems fall into a small number of categories. For each one below you will find symptoms, likely causes and fixes. If you are stuck, gather the exact error and context, remove secrets, and use the Bug Fixing or Railway Troubleshooting prompts.
Installation
| Symptom | Cause | Fix |
|---|---|---|
code: command not found | VS Code shell command not installed | Command Palette → "Shell Command: Install 'code' command in PATH", then open a new terminal |
claude: command not found | CLI not installed or not on PATH | Reinstall using the official instructions; open a new terminal; check echo $PATH |
npm: command not found | Node.js not installed | Install the LTS version from nodejs.org or with a version manager |
EACCES permission errors with npm global installs | npm global folder owned by another user | Use the official installer for the tool, or a Node version manager; avoid sudo npm install -g |
| macOS blocks an app "from an unidentified developer" | Gatekeeper | Confirm the download came from the official site, then allow it in System Settings → Privacy and Security |
| Extension not found in VS Code | Search or marketplace issue | Search "Claude Code" and confirm the publisher is Anthropic; update VS Code |
GitHub authentication
| Symptom | Cause | Fix |
|---|---|---|
Authentication failed on push | No credentials or expired token | Run gh auth login, choose HTTPS, and authenticate Git with GitHub credentials |
Permission denied (publickey) | Remote uses SSH but no SSH key is configured | Switch to HTTPS: git remote set-url origin https://github.com/USER/REPO.git, or set up an SSH key |
Repository not found | Wrong URL, wrong account, or no access to a private repo | Check git remote -v and gh auth status; confirm the repository exists under that account |
| Password rejected | GitHub no longer accepts account passwords for Git operations | Use gh auth login or a personal access token |
bash
gh auth status
git remote -vGit errors
| Symptom | Cause | Fix |
|---|---|---|
not a git repository | Command run outside the project, or Git not initialized | cd into the project; run git init if needed |
rejected ... fetch first | Remote has commits you do not have locally | git pull --rebase then git push. Never force-push to resolve this on main |
| Merge conflict | Same lines changed in two places | Open the files in VS Code, choose the correct version, git add and commit; or ask Claude Code to resolve and explain |
.env was committed | Missing .gitignore entry | Add to .gitignore, git rm --cached .env, commit — and rotate every secret it contained |
src refspec main does not match any | No commits yet, or branch named differently | Make a first commit; check git branch |
| Accidental changes | Edits you want to discard | Review with git status and git diff first; ask before running destructive commands like git reset --hard |
Application startup
| Symptom | Cause | Fix |
|---|---|---|
Cannot find module ... | Dependencies not installed | npm install |
Port 3000 is already in use | Another server is running | Stop it with Ctrl+C in its terminal, or use the port the framework suggests |
| Blank page | Client-side error | Open the browser console and copy the first red error |
| Works for Claude Code but not for you | Different terminal, folder or Node version | Run from the project root; compare node --version |
| Changes not visible | Cached build or stale browser tab | Restart the dev server; hard refresh with Cmd+Shift+R |
Database connections
| Symptom | Cause | Fix |
|---|---|---|
ECONNREFUSED locally | Local database not running | Start the database, or use a separate development database |
ECONNREFUSED or ENOTFOUND on Railway | Wrong or missing DATABASE_URL reference | Check the reference variable and that the database service name matches |
password authentication failed | Stale credentials copied by hand | Use a reference variable instead of a copied value |
relation "..." does not exist | Migrations not applied | Run the migration command for your ORM against the correct database |
| Too many connections | Each request opens a new connection | Ask Claude Code to use a shared client or connection pooling |
| SSL errors | SSL mode mismatch | Check your ORM's documentation for the correct SSL settings for your host |
Environment variables
| Symptom | Cause | Fix |
|---|---|---|
undefined value at runtime | Variable not set in this environment | Compare Railway variables against .env.example |
| Variable set but not picked up | Service not redeployed, or set on the wrong service | Set it on the application service and redeploy |
| Browser cannot read a variable | Client-side variables require a public prefix in some frameworks | Use the framework's public prefix only for non-secret values |
| Secret visible in browser source | Secret given a public prefix | Remove the prefix, move logic to the server, rotate the secret |
| Works locally, not in production | .env exists only on your computer | Every variable must also be set in Railway |
Build failures
| Symptom | Cause | Fix |
|---|---|---|
| Type errors only in production build | Development server is more lenient | Run npm run build locally and fix all errors |
| Import path works on Mac, fails on Railway | Case-insensitive macOS file system | Make import casing match file names exactly |
JavaScript heap out of memory | Large build | Simplify heavy imports, or ask ChatGPT for build memory options appropriate to your framework |
| Wrong Node version | Platform default differs from local | Specify the version in package.json engines or as documented by Railway |
| Missing build-time variable | Value required during build | Set it in Railway before building |
bash
npm run build
npx tsc --noEmitRailway networking
| Symptom | Cause | Fix |
|---|---|---|
| Deployment succeeds but URL shows an error | App not listening on PORT | Use the PORT environment variable |
| No public URL | Domain not generated | Generate a domain in the service networking settings |
| Health check failing | Wrong path or slow start | Confirm path, check runtime logs |
| App cannot reach database privately | Private hostname or port incorrect, or services in different environments | Use the reference variable for the private URL; confirm both services are in the same project environment |
| Unexpected network costs | Database traffic over the public URL | Use the private connection variable |
DNS
| Symptom | Cause | Fix |
|---|---|---|
| Domain not resolving | Record missing, wrong name, or still propagating | Compare against Railway's values; check with dig; wait for propagation |
app.example.com.example.com | Full domain entered where provider appends it | Enter only app in the name field |
| Apex domain will not accept a CNAME | Provider lacks CNAME flattening | Use a provider that supports ALIAS/flattening, or use www and redirect |
| Email stopped working | MX or TXT records deleted or changed | Restore from your screenshot; only change records Railway requires |
| Railway shows domain not verified | Verification record missing or incorrect | Add the exact record Railway displays |
bash
dig app.example.com +short
dig app.example.com CNAME +shortHTTPS
| Symptom | Cause | Fix |
|---|---|---|
| Certificate warning right after setup | Certificate not issued yet | Wait for verification and issuance, then retry |
| Certificate never issues | DNS points elsewhere, verification TXT record missing, or a DNS proxy interferes | Ensure both the CNAME and TXT records match Railway exactly; with Cloudflare proxying, use SSL mode Full (not Full Strict) |
| Mixed content warnings | Page loads http:// resources | Ask Claude Code to use HTTPS or relative URLs |
| Sign-in redirect fails after domain change | Callback URL still points to old domain | Update callback URLs and base URL variables |
Still stuck?
Paste the full context into ChatGPT: what you were doing, what you expected, what happened, the exact error, what you have tried, and relevant configuration (without secrets). Ask for the most likely root cause, how to confirm it, and — if code must change — one consolidated LOW GAS Claude Code prompt.