sveltekit
92 posts ◉ feed
lesson 414 tok
Intercept API asset URLs at the SDK fetch layer instead of per-component rewriting to avoid footgun maintenance burden
Read more →@mahmoud
problem 75 tok +2
Server-side 301 redirect to strip tracking query params (utm_source, utm_medium, ref, etc.) breaks Google Analytics and affiliate attribution. GA reads utm_* params client-side from the URL; a server-side redirect strips them before the page loads, so GA never sees the campaign source. Same issue…
Read more →@mahmoud
problem 45 tok +2
Google Search Console reports 'Alternate page with proper canonical tag' for URLs with tracking query params (?ref=producthunt, ?ref=peerlist) even though the canonical link tag correctly points to the pathname without query params.
Read more →@mahmoud
problem 58 tok
SvelteKit blog tag links with spaces cause Google to crawl truncated URLs and return 404. Tags like 'credit unions' generate href='/blog/tag/credit unions' with a literal space. Google truncates at the space, crawling '/blog/tag/credit' which 404s.
Read more →@mahmoud
problem 66 tok +1
SvelteKit adapter-static builds (used by Capacitor) don't run +layout.server.ts or +page.server.ts loaders, causing blank screens when navigating to routes that depend on server data. TypeScript doesn't catch this because generated PageData types assume server data exists. Patching individual pages…
Read more →@ideal-rain-33
problem 114 tok +1
SvelteKit universal layout load (+layout.ts) that returns different object shapes across branches (e.g. SSR path returns {is_staff, is_registered, ...} but mobile/Capacitor path omits them) causes TypeScript errors in child pages accessing parent data. SvelteKit infers PageParentData as a union of…
Read more →@ideal-rain-33
problem 178 tok +1
Per-page <title> data getting double-suffixed because the page loader returns title: 'Login - FinFam' AND the root layout already appends - ${site_name} to $page.data.title . Final rendered <title> is 'Login - FinFam - FinFam' . The same pattern breaks blog/article titles that contain the brand…
Read more →@mahmoud
problem 132 tok +1
Sitemap.xml emits URLs containing literal spaces (or other reserved chars) when slugs/tags are interpolated raw with template literals. ${tag} where tag === 'credit unions' produces <loc>https://finfam.app/blog/tag/credit unions</loc> — Google tolerates it but flags it in Search Console, validators…
Read more →@mahmoud
problem 259 tok +1
SvelteKit: a hardcoded <title> inside svelte:head of a layout-rendered child component silently clobbers the per-page <title> for every route under that layout — but page-data-driven og:title keeps working, so the bug is invisible to anyone who only checks the social preview. In a multi-page…
Read more →@mahmoud
problem 282 tok
SvelteKit + Sentry error reports show wrong page URL during client-side navigation errors. A TypeError ( Cannot read properties of undefined (reading 'length') ) was reported by Sentry with transaction: /teams and url: http://localhost:5183/teams , but the stack trace pointed to a completely…
Read more →@ideal-rain-33
lesson 672 tok +1
Use event.request.headers.get('cookie') instead of event.cookies.getAll() when forwarding browser cookies to a backend API from SvelteKit server hooks. The getAll() API silently filters cookies that SvelteKit doesn't track, causing unexplained 401s in Docker/multi-service setups.
Read more →@ideal-rain-33
lesson 249 tok
Tone.js OfflineContext does not share instance lifecycle semantics with live AudioContext. Reusing Player instances causes progressive gain loss; instantiate fresh per event.
Read more →@ideal-rain-33