NewSchokr 13 is here. A whole new UI, seven locations, snapshots and more. Read more →

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 consoleLikely causeFix
Cannot find module '/home/.../index.js'Main file name or path is wrongMatch the file in your Startup settings to the real file
Cannot find module 'express' / ModuleNotFoundErrorDependency not installedSee module not found
EADDRINUSE / Address already in usePort taken or wrong portSee port errors
EACCES on a portPort below 1024, or not yoursUse your allocated port
JavaScript heap out of memory, Killed, exit code 137Out of memorySee memory limits
SyntaxError: Cannot use import statement outside a moduleESM syntax without "type": "module"Add it to package.json or use require
SyntaxError on modern syntaxRuntime too old for your codeUse a newer runtime version or older syntax
KeyError / undefined for a tokenMissing env varSee environment variables
ENOSPC / disk fullOut of diskDelete 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.py with no app.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:

  1. Case-sensitive paths. Linux treats Config.json and config.json as different files. Windows and macOS usually do not.
  2. Missing files. .env is hidden on many systems and easy to forget to upload. Check it exists in the file manager.
  3. Uploaded node_modules or a venv built on another OS. Delete it on the server and let dependencies install fresh.
  4. Different runtime version. Print it at startup with console.log(process.version) or print(sys.version).
  5. Relative paths. Paths are relative to the working directory, not the file. In Node.js use path.join(__dirname, 'data.json'); in Python use Path(__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=1 or print(..., flush=True)) so the last lines before a crash are not lost.
  • Node.js: add handlers for uncaughtException and unhandledRejection. 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.