Tutorials
Practical tutorials for the work we actually do. Pick one, read it in order, and apply it.
ModuleNotFoundError has a handful of causes: the wrong Python, an inactive virtual environment, the wrong folder, or a file that shadows a module. Check them in order instead of reinstalling.
print() is for the output a person asked for. logging is for messages about the program: levels you can turn down, a file with times, and tracebacks for errors. Set it up once in main() and use a logger per module.
Separate zero collected tests from an import failure, install into the correct environment, and prove the selected test catches a broken assertion.
Stop checking error messages with includes(). Extend Error, set name, add the fields the handler needs, catch with instanceof, and wrap low-level errors with cause so the real reason isn't lost.
Your date moves a day because one part of the code uses UTC and another uses local time. Find which step does it, keep calendar days as YYYY-MM-DD strings, and name the time zone when you format.
The file was loaded as a classic script or CommonJS, where import isn't allowed. The fix in the browser is type="module". In Node it's "type": "module" or .mjs, and recent npm init writes "type": "commonjs" for you.
"Unexpected token in JSON" means JSON.parse got text that isn't JSON. Read the exact message, log the raw text, and match it to one of five causes. Most of the time it's an HTML error or login page.
Add Vitest to a project you already have and get real tests passing: a pure function with it.each, then an async function that calls fetch, tested with a fake instead of the network.
Reproduce a fixed-width overflow on a narrow screen, locate the offending element and verify a repair without clipping the page.
Read a long assignability error from the bottom, then fix the usual causes: a wrong value, a wrong type and a literal widened to string. After this, a nested mismatch points to one property.
Read the error, then fix it the right way: group by the column, aggregate it or move the aggregate into a subquery. After this, you know which fix keeps your numbers correct.
Add a pg_isready health check to a database and make the app wait for it with service_healthy. After this, you can stop an app from failing on a database that is still starting.