TIL · 5 entries
Today I learned
One concrete thing per post. The daily friction of shipping, written down before I forget which error message taught me which lesson.
- Apr 20, 2026 Satori's Font.lang needs BCP-47, not ISO-639 Building OG cards with Arabic text and got a runtime enum crash on lang: 'ar'. Satori demands ar-AR (BCP-47), not just ar.
- Apr 19, 2026 Pagefind auto-filters search by html[lang] with zero config Expected to spend a day wiring multilingual search. Pagefind reads html[lang] at both index and browser time - each locale auto-scopes for free.
- Apr 18, 2026 Astro's prerender breaks import.meta.url - use process.cwd() Tried to load fonts via import.meta.url in an endpoint. Astro bundled the file into dist/.prerender/chunks/, breaking the path. process.cwd() is stable.
- Apr 17, 2026 Node 22's builtin test runner handles TypeScript imports natively Skipped adding Vitest to the site repo. node --experimental-strip-types --test 'tests/unit/**/*.test.mjs' runs TS-importing tests with zero new dependencies.
- Apr 16, 2026 Rollup statically analyses dynamic imports - hide the specifier `await import('/pagefind/pagefind.js')` fails because Rollup tries to resolve the specifier at build time. Concat the string at runtime to hide it.