Debugging portfolio
Prerequisite: node-migration-planning. Objective: Document reproducible failure investigation. Each example is independent. Use Node.js 22.16.0 in a disposable directory; save as main.mjs and run node main.mjs. No external service is contacted.
How it works
Start with observable behavior and the exact runtime. Separate module resolution errors, application exceptions, transport failures and dependency limits. Reduce a failing service to a synthetic fixture that preserves the failure. A successful correction must change the observed symptom and preserve expected behavior; record negative cases. Do not copy private logs or claim production experience from local exercises.
Reproduce lost async error handling
async function fetchItem(){throw Error('missing item');}try{await fetchItem()}catch(e){console.log(e.message)}Expected output:
missing itemAwait makes the rejected promise observable to the surrounding catch.
Verify a regression for zero inventory
import assert from 'node:assert/strict';function available(qty){return qty>0;}assert.equal(available(0),false);assert.equal(available(1),true);console.log('boundary verified');Expected output:
boundary verifiedA minimal boundary test makes a previously ambiguous rule reproducible.
Common mistake
Never include customer payloads, secrets, private paths or fabricated incidents in a portfolio.
Practice
Document a reproducible module resolution error with exact command, error code, corrected import and a regression assertion.
Reference candidate: node-debugging-portfolio-lookup (route unverified). Original instructional model; independent source review pending.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Debugging portfolio — knowledge check
Apply the lesson to a fresh scenario and explain the evidence boundary.
What belongs in a debugging case study?
Why minimize a reproduction?
What is a successful regression test?