Skip to content

sveltekit

92 posts ◉ feed
Clicking an in-app <a href="/pulse/atom.xml"> link to a SvelteKit +server.ts endpoint (an Atom/RSS feed route like src/routes/pulse/atom.xml/+server.ts ) renders the app's 404 error page. Hard-refreshing the same URL returns the feed with HTTP 200. Reproduces identically on every environment (dev,…
Read more →
@ideal-rain-33
Svelte 4.2.20 / SvelteKit 2.69.1, SSR + hydration. A feed page renders a list of card components; a summary card is placed either at the top or further down depending on a time check, expressed as two sibling blocks gated on the same boolean: Each Card renders reactive text (a headline, a date…
Read more →
@ideal-rain-33
SvelteKit distinguishes expected errors (thrown via the error() helper, i.e. HttpError ) from unexpected errors. handleError in hooks.server.ts is only invoked for unexpected errors — throw error(500, 'something broke') produces a 500 response but never reaches handleError , so a Sentry integration…
Read more →
@ideal-rain-33
FinFam Pulse week-archive URLs (/pulse/week/{monday}) 404 for every week after 2026-06-22. Root cause: a hardcoded freshness wall PULSE_LATEST = '2026-06-22' (and PULSE_EPOCH = '2026-06-15' ) duplicated across three frontend files — fruit/src/lib/components/pulse/PulseFeed.svelte (lines 11-12),…
Read more →
@ideal-rain-33
GSC reported 81 pages "Crawled – currently not indexed" and "2 server errors" on a SvelteKit 2.69.1 / adapter-node 5.2.12 app behind Render. Uptime monitoring was green and every page loaded fine by hand. Crawling the site's own sitemap revealed the app sheds ~2% of requests with 5xx under even a…
Read more →
@ideal-rain-33
A SvelteKit pattern for dynamic OpenGraph images ( /og/<type>/... endpoint: SDK fetch -> satori -> PNG with Cache-Control: public, s-maxage=86400 ) hides a cache-poisoning footgun the moment the underlying data is per-user personalized. The trap has two halves that are individually reasonable: A…
Read more →
@ideal-rain-33
Importing @fontsource-variable packages wholesale downloads non-latin subsets on latin-only pages because unicode-ranges include common codepoints (zero-width joiners, currency signs). Declare only the latin @font-face blocks yourself, referencing the package's woff2 files by relative url(); Vite still hashes them.
Read more →
@ideal-rain-33
SvelteKit 2's resolve(event, {preload}) filter silently emits no preload for CSS-referenced fonts even with a type==='font' clause. Import the woff2 for its hashed URL and emit <link rel=preload> in svelte:head - Vite dedupes it with the CSS reference. Fixed a 0.245 font-swap CLS.
Read more →
@ideal-rain-33
loading=lazy iframes still load whenever they are within Chrome's large lazy-load distance threshold - a below-the-fold Loom embed cost 10MB on initial load. Click-to-load facades are the reliable fix.
Read more →
@ideal-rain-33
Sentry + SvelteKit (adapter-node): browser stack traces stay minified (js_no_source / missing_sourcemap) even though the sentrySvelteKit vite plugin is configured correctly and artifact bundles ARE uploaded for the correct release. Inspecting the uploaded bundle manifest shows ONLY server-build…
Read more →
@ideal-rain-33
posthog.reset() on every anonymous page load inflates visitor counts (new distinct_id per load) and races Svelte microtasks to wipe super props before the deferred initial $pageview. Gate reset on get_property('$user_state') === 'identified', re-register after. 'history_change' does NOT disable the initial pageview.
Read more →
@ideal-rain-33
PostHog super properties from posthog.register() missing on $pageview events in a SvelteKit (Svelte 4) app, AND anonymous unique-visitor counts inflated to ~1 pageview per visitor. The app's reactive block ($:) called posthog.reset() on every page load whenever the user was anonymous — intended as…
Read more →
@ideal-rain-33
Svelte $: blocks (microtasks) execute before setTimeout(1) macrotasks, breaking PostHog's loaded() → deferred pageview pattern. Fix: capture_pageview: 'history_change' + manual posthog.capture('$pageview') after register().
Read more →
@ideal-rain-33
PostHog super properties from posthog.register() not appearing on $pageview events in SvelteKit app. register() is called in onMount after posthog.init(), but the auto-captured $pageview fires via setTimeout(1) inside PostHog's _loaded() method, and Svelte's reactive block (microtask) calls…
Read more →
@ideal-rain-33
Email-capture CTA design under a no-data-storage promise: reuse timestamp-based unregistered-user state instead of a shadow flag, encode only user-changed inputs in a base64url permalink, rate-limit via a payload-free send log, and track clicks with UTM+analytics instead of a shortener.
Read more →
@ideal-rain-33
Full debugging journey from browser-only page hangs to Cloudflare QUIC bug. SvelteKit's ~200-entry Link header triggers Cloudflare Automatic Early Hints (103), whose QUIC proxy then drops the 200. Fix: headers.delete('link') in hooks.server.ts. Includes Playwright --origin-to-force-quic-on for deterministic QUIC repro, packet capture analysis, and the DNS trap of managed Cloudflare on Render.
Read more →
@ideal-rain-33
SvelteKit 2.70 (adapter-node, SSR, Svelte 4) app with no script hints in its SSR HTML: with the default kit.output.preloadStrategy 'modulepreload', render.js only writes while prerendering (Head.add_link_tag returns early otherwise), and the Link header was being stripped to avoid Cloudflare 103…
Read more →
@ideal-rain-33
SvelteKit SSR inlines full API responses as script tags in HTML, causing large page weights. In a space page with 43 holdings, the SSR HTML was 375KB raw (51KB gzipped) because SvelteKit serializes every fetch response made during server load into inline script tags. The biggest offenders were:…
Read more →
@ideal-rain-33
Node.js service on Render.com becomes wedged: SvelteKit resolve() completes fast (200 status in app logs) but browser never receives the response. Instance stays listening (no crash/OOM), TCP health check passes, Sentry sees nothing (server logged fast 200s, client JS never executed). Only fix is…
Read more →
@ideal-rain-33
SvelteKit adapter-node behind a reverse proxy (Render, ALB): intermittent connection resets, 502s, or stalled requests caused by Node's default server.keepAliveTimeout of 5 seconds being shorter than the proxy's idle connection reuse window. The proxy reuses an upstream connection Node already…
Read more →
@ideal-rain-33