The symptom

Perfect on your machine. Broken on the live site.

What's different

It's almost never the code. It's the environment, and the list of candidates is short:

Environment variables. Set in your .env, missing from the host's dashboard. The most common cause by a distance.

Case sensitivity. macOS and Windows don't care about Header.js versus header.js. Linux does, and your server is Linux.

File paths. A relative path that worked because of where you happened to run the command.

The database. A file on your laptop that doesn't exist in production, or a connection string pointing somewhere unreachable.

Node, PHP or Python version. Different major version, different behaviour.

Missing build step. Files generated locally but never generated or committed for production.

HTTPS. Mixed content, secure cookies, and redirects that only exist in production.

The fix

prod-only-bug.txt
Works locally, fails in production. Stack: <stack>. Host: <host>.
The production error: <paste — from the host's logs, not the browser>

Go through the standard differences between a local and a production
environment and tell me which could produce this specific error:
env vars, file path case, working directory, database, runtime
version, missing build artefacts, HTTPS.

For each plausible one, exactly how do I check it on the host?

Get the real error first

The browser shows you a generic 500. The host's logs show you the actual exception with a line number. Everything else is guesswork until you've read those.

If your host makes logs hard to reach, that's worth fixing before anything else — you'll need them every time.

Case sensitivity is the one that catches everyone at least once. If a file loads locally and 404s in production, check the capitals in the filename before anything else.