Debugging
Finding out why something broke: reading errors, browser dev tools, logs, and the classic works-locally-fails-in-production gap.
130 posts · page 3 of 5
"Command Not Found": The PATH Variable Explained
"command not found" or "is not recognized as an internal or external command" usually means the program is installed but your terminal doesn't know where to look. How PATH works on Mac, Linux and Windows, how to check it, and how to add a folder permanently.
"Objects Are Not Valid as a React Child": How to Fix It
React can render text, numbers and elements, but not plain objects. This error means you put an object, a Date, or a Promise inside JSX. How to find which value it is from the 'keys' in the message, and the fix for each common case.
TypeScript "Object Is Possibly Undefined" (or Null): How to Fix It
TypeScript warns that a value might be undefined or null before you use it — the exact situation that causes 'Cannot read properties of undefined' at runtime. The right fixes: optional chaining, nullish coalescing, early returns and narrowing, typed state and refs, and when the ! operator is acceptable.
NULL in SQL Explained: Why = NULL Never Works
NULL in SQL means 'unknown', not zero or an empty string — which is why WHERE column = NULL returns nothing. How IS NULL, COALESCE, NULLIF and IS DISTINCT FROM work, how NULL affects counts, sums, NOT IN and unique constraints, and when to use NOT NULL.
npm run build Fails but npm run dev Works: Why and How to Fix It
Development mode is forgiving; production builds are strict. The common reasons a build fails when dev works — TypeScript and lint errors, case-sensitive imports, missing environment variables, server-only code in the browser, prerendering errors and memory — with the fix for each.
npm ERR! code ENOENT: What It Means and How to Fix It
ENOENT means 'no such file or directory'. In npm it usually means you're in the wrong folder, there's no package.json, a script points at a missing file, or node_modules is broken. How to read the error and fix each cause.
npm EACCES: Permission Denied — Fix It Without sudo
EACCES means npm tried to write somewhere your user isn't allowed to — usually the global packages folder after Node was installed with sudo or a system package. Why sudo npm is the wrong fix, and the right ones: a Node version manager or a user-owned global prefix.
"fatal: not a git repository": What It Means and How to Fix It
Git can't find a .git folder in the current directory or any parent. The usual causes — wrong folder, never ran git init, a deleted or broken .git, Docker builds and CI without Git history, safe.directory ownership checks — and the fix for each.
What Is node_modules? (And When to Delete It)
node_modules is the folder where npm installs your project's dependencies. Why it's so big, why it must never go into Git, when deleting it and reinstalling fixes things, the right commands on Mac, Linux and Windows, and how to reclaim disk space across old projects.
Node.js Event Loop Lag: Finding What Blocks Your Server
When one request's CPU work blocks the event loop, every other request waits. How to measure event loop delay and utilisation with perf_hooks, the usual culprits (big JSON, sync crypto, regex backtracking, sync fs), profiling with --cpu-prof, the libuv threadpool, and fixes from chunking to worker threads.
"No Space Left on Device": Finding and Freeing Disk Space on a Server
When a server's disk fills up, databases stop writing, deploys fail and apps crash with ENOSPC. How to find what's using space with df and du, the usual culprits (logs, Docker, journald, old releases, deleted-but-open files), inode exhaustion, and how to stop it happening again.
"new row violates row-level security policy" in Supabase: How to Fix It
Supabase (Postgres) blocked an insert or update because no RLS policy allows it. Why it happens, how to write an INSERT policy with WITH CHECK, the user_id default trick, the hidden SELECT-after-insert problem, storage uploads, and why you must never 'fix' it by disabling RLS.
React "Maximum Update Depth Exceeded": Causes and Fixes
React stops your app when a component keeps updating itself in a loop. The usual causes — setState in useEffect with a dependency that changes every render, objects and functions in dependency arrays, calling a setter during render — and how to fix each.
Linux Pressure Stall Information (PSI): Measuring Resource Contention
CPU percentage and free memory don't tell you whether your workload is actually being slowed down. Pressure stall information does: the share of time tasks were stalled waiting for CPU, memory or I/O. Reading /proc/pressure, some vs full, per-cgroup pressure, triggers, and using PSI for alerts and OOM handling.
The Linux OOM Killer: Why Your Process Was Killed
When Linux runs out of memory it picks a process and kills it. How the kernel OOM killer chooses its victim, oom_score and oom_score_adj, cgroup v2 memory limits versus system-wide OOM, overcommit, reading the dmesg report, exit code 137 in containers, and how to stop it happening.
"LF Will Be Replaced by CRLF": What the Git Warning Means and How to Fix It
Windows ends lines with CRLF, macOS and Linux with LF, and Git warns when it converts between them. What the warning means, whether it's a problem, the right core.autocrlf setting for your OS, and the .gitattributes file that fixes line endings for the whole team.
How to Kill a Process in Linux (kill, pkill, killall, and Ports)
Find a stuck or runaway process and stop it: ps and pgrep to find it, kill to stop it politely, kill -9 when it won't, pkill and killall by name, killing whatever is using a port, and why a killed app comes straight back if a process manager runs it.
"TypeError: X Is Not a Function": The Common Causes and Fixes
"is not a function" means you tried to call something that isn't a function — usually undefined, an object, or the wrong kind of value. The usual suspects: .map on a non-array, wrong import, missing await, a typo, or a name collision. How to diagnose each.
React "Invalid Hook Call": The 3 Causes and How to Fix Each
React throws 'Invalid hook call' when a hook runs outside a component, when hooks are called conditionally or in a regular function, or when two copies of React are loaded. How to tell which one you have and fix it — including npm ls react and linked packages.
HTTP Headers Explained: The Hidden Part of Every Request
Every web request and response carries headers — extra information about the content, the client, authentication, caching and security. The headers you'll meet most (Content-Type, Authorization, Cookie, Cache-Control, CORS), how to see them in DevTools, and how to set them.
How to Test an API: Tools and a Simple Checklist for Beginners
Testing an API means sending requests and checking the responses — by hand with curl, Postman, Bruno or your editor, and automatically with tests that run on every change. What to check (status codes, body, auth, bad input), example tests, and a checklist.
How to Hard Refresh and Clear the Cache (Chrome, Safari, Firefox, Edge)
Changed your site but still seeing the old version? A hard refresh reloads the page while ignoring the cache. The shortcuts for every browser on Mac and Windows, how to clear the cache for one site, why hard refresh sometimes isn't enough, and how to stop users seeing stale versions.
Git Push Rejected: "Updates Were Rejected Because the Remote Contains Work"
git push fails with "rejected — fetch first" or "non-fast-forward" when GitHub has commits you don't. How to pull and combine them safely, when force-pushing is fine and when it destroys work, and the other rejection messages: protected branches, large files, and secrets.
"Permission Denied (publickey)" on GitHub: How to Fix It
GitHub rejected your SSH key — either you don't have one, it isn't added to GitHub, your SSH agent isn't offering it, or you're using the wrong account. A step-by-step fix with ssh -T, plus the HTTPS alternative and the 'Support for password authentication was removed' error.