Day 11 resolve and asset
The 404 monster lurks in every codebase, waiting to pounce on typos and broken links. But fear not — SvelteKit 2.26 brought two trusty helpers to keep your routes and assets safe: resolve and asset from $app/paths.
The resolve function is your type-safe compass for navigation. Pass it a route ID and SvelteKit validates it against your actual routes — typos light up red in your editor before they ever reach production. Even dynamic routes like /tree/[name] get proper parameter handling, ensuring every path leads somewhere real.
For static files, asset wraps your references to the static folder with autocomplete and validation. No more wondering if it's /elf.svg or /elves.svg — your editor knows what's in Santa's bag!
Pair these with ESLint (npx sv add eslint) to scan your entire codebase for unsafe routes. And when requirements change — like serving everything from /advent-of-svelte-2025 — just update your config. All your resolve calls automatically include the new base path. The 404 monster doesn't stand a chance!