Part 02 of the notebook
FIXEDFixes
Exact error message, why it happens, the fix that worked, versions tested. Errors I hit while building. Search your exact error message and the fix is at the top.
press / and paste your error.
- No.010
Fix: Vite “Failed to resolve import” for @ alias imports
Vite can't find an @/ import until the alias is in vite.config. Why tsconfig paths alone don't help, and the new Vite 8 Rolldown wording. Reproduced.
> [vite] Internal server error: Failed to resolve import "@/utils/hello"
FIXED1 min - No.009
Fix: “trying to use tailwindcss directly as a PostCSS plugin”
Tailwind CSS v4 moved its PostCSS plugin to a separate package. The two-line change to postcss.config.js, reproduced and verified.
> Error: It looks like you're trying to use `tailwindcss` directly as a PostCSS
FIXED1 min - No.008
Fix: “Cannot apply unknown utility class” in Tailwind CSS v4
Two causes trigger this Tailwind v4 error: an unmapped theme variable (border-border) or a CSS file missing @reference. Both reproduced and fixed.
> Error: Cannot apply unknown utility class `border-border`
FIXED1 min - No.007
Fix: npx tailwindcss init “could not determine executable to run”
Tailwind CSS v4 removed the init command, so npx has nothing to run. Two fixes, both reproduced: set up v4 without a config file, or pin v3.
> $ npx tailwindcss init
FIXED2 min - No.006
Fix: npm ERESOLVE unable to resolve dependency tree (React 19)
npm refuses to install a package whose peer range doesn't include your React version. Four fixes compared, and why --legacy-peer-deps alone breaks later.
> npm error code ERESOLVE
FIXED1 min - No.005
Fix: ERR_REQUIRE_ESM require() of ES Module not supported
Why require() of an ES module fails, why it mostly stopped failing on Node 22.12+, and the new errors you hit instead. All reproduced on Node 24.
> Error [ERR_REQUIRE_ESM]: require() of ES Module ...\node_modules\chalk\source\index.js
FIXED1 min - No.004
Fix: ERR_OSSL_EVP_UNSUPPORTED digital envelope routines (webpack 4)
Old webpack 4 builds crash on Node 17+ with 0308010C. Upgrading webpack 4 to 4.47.0 fixes it without the legacy OpenSSL flag. Reproduced on Node 24.
> Error: error:0308010C:digital envelope routines::unsupported
FIXED1 min - No.003
Fix: EADDRINUSE address already in use :::3000 on Windows
Your Node dev server won't start because the port is taken. Find the process holding it, stop it, and restart. Every step reproduced on Windows 11.
> node:events:486
FIXED1 min - No.002
Fix: __dirname is not defined in ES module scope (Node 24)
ES modules don't have __dirname or __filename. The one-line modern fix (import.meta.dirname) and the fallback for older Node, both run on Node 24.
> console.log(path.join(__dirname, "data.json"));
FIXED1 min - No.001
Fix: “Cannot use import statement outside a module”
The fix for Node and the browser. On Node 24 a plain .js file now often just works, so here's exactly when the error still happens. Reproduced in both.
> SyntaxError: Cannot use import statement outside a module
FIXED1 min
Post card · Newsletter
Get the next fix in your inbox.
One short email when a new entry is published. No spam, never shared, and you can leave any time.
— Nilay