App crashes on start: common causes and fixes
Your Node.js, Bun or Python app stops right after starting on Schokr? Check these common causes, from missing files to memory and ports.
Updated · 2 min read
If your app starts and then immediately stops, the reason is almost always printed in the console just before it exits. Scroll up to the first error line, then match it against the causes below.
Quick checklist
| Error in console | Likely cause | Fix |
|---|---|---|
Cannot find module '/home/.../index.js' | Main file name or path is wrong | Match the file in your Startup settings to the real file |
Cannot find module 'express' / ModuleNotFoundError | Dependency not installed | See module not found |
EADDRINUSE / Address already in use | Port taken or wrong port | See port errors |
EACCES on a port | Port below 1024, or not yours | Use your allocated port |
JavaScript heap out of memory, Killed, exit code 137 | Out of memory | See memory limits |
SyntaxError: Cannot use import statement outside a module | ESM syntax without "type": "module" | Add it to package.json or use require |
SyntaxError on modern syntax | Runtime too old for your code | Use a newer runtime version or older syntax |
KeyError / undefined for a token | Missing env var | See environment variables |
ENOSPC / disk full | Out of disk | Delete caches and old builds, or add disk |
The app exits cleanly with no error
If the process ends with no error, your code simply finished. Common reasons:
- The entry file only defines things and never starts a server. For example, a Flask
app.pywith noapp.run()and no gunicorn command. - A Python script without a loop or
run_polling()style call at the end. - Your entry file is a library file, not the one that calls
listen().
Make sure the file you start actually starts a long-running server or bot.
It works on my computer
Differences between your machine and the server that cause crashes:
- Case-sensitive paths. Linux treats
Config.jsonandconfig.jsonas different files. Windows and macOS usually do not. - Missing files.
.envis hidden on many systems and easy to forget to upload. Check it exists in the file manager. - Uploaded
node_modulesor a venv built on another OS. Delete it on the server and let dependencies install fresh. - Different runtime version. Print it at startup with
console.log(process.version)orprint(sys.version). - Relative paths. Paths are relative to the working directory, not the file. In Node.js use
path.join(__dirname, 'data.json'); in Python usePath(__file__).parent / "data.json".
Crash loops
If the app crashes, restarts and crashes again, stop the server, fix the problem, then start it again. Watching a restart loop can hide the first, most useful error.
Get better error output
- Python: run unbuffered (
PYTHONUNBUFFERED=1orprint(..., flush=True)) so the last lines before a crash are not lost. - Node.js: add handlers for
uncaughtExceptionandunhandledRejection. See reading your app's logs.
Still stuck?
Copy the full error from the console (remove tokens), and post it with your startup settings in the Schokr Discord.