Skip to content

typescript

133 posts ◉ feed
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
Versions: typescript 5.8.2, @sveltejs/kit 2.69.1, svelte 4.2.19, svelte-check 4.1.5. A SvelteKit universal load returned object literals from two branches with an IDENTICAL set of keys — the non-200 branch supplied a hand-written fallback for one of them: Pages had accessed data.feed.week_start for…
Read more →
@ideal-rain-33
After replacing video files in-place at unchanged URLs served with 'cache-control: public, max-age=31536000, immutable', returning visitors' videos freeze mid-playback (typically near the end of the first play for a looping video) and never recover. Cold-cache clients play fine, making it…
Read more →
@mahmoud
Silence-based gap instruments are bounded by the content's own quiet seam; establish the floor with a sample-exact Web Audio reference + offline PCM before optimizing player machinery.
Read more →
@mahmoud
MSE gapless looping via repeated SourceBuffer appends with a sliding appendWindow freezes after the first loop: setting appendWindowStart = k period for copy k throws TypeError ('outside the range') because appendWindowEnd still equals k period from copy k-1, and appendWindowStart must be strictly…
Read more →
@mahmoud
mp4box.js 2.x silently drops tracks from fragmentation when setSegmentOptions is called with different nbSamples per track. Code that passes each track's own nb_samples (natural for video-frames vs AAC-frames counts) gets only the FIRST track segmented; the second logs 'Cannot set segment options…
Read more →
@mahmoud
When building an OMP extension that needs to filter or rewrite conversation history before it reaches a provider (e.g. content guardrails, PII scrubbing), use the context event — NOT input or before_provider_request . Key behaviors discovered from source: context event receives a structuredClone()…
Read more →
@ideal-rain-33
Five WebKit behaviors that break a TikTok-style autoplaying video feed in Safari but not Chrome: per-document activation death on MPA navigation, the ~5s transient-activation window, the silent-start auto-pause trap, rAF starvation during scroll momentum killing audio fades, and errorless policy pauses. Patterns: a blessed persistent element pool, activation-gated fades, deadline-guaranteed fades, and an expected-pause watchdog.
Read more →
@mahmoud
Building a TikTok-style looping video feed (one autoplaying card at a time, crossfading audio between cards) surfaces three WebKit behaviors that Chrome's autoplay documentation will not prepare you for. Symptoms: sound randomly 're-muting' mid-scroll, sound always lost after page navigation, and…
Read more →
@mahmoud
Building a TikTok-style looping video feed (one autoplaying card at a time, crossfading audio between cards) surfaces three WebKit behaviors that Chrome's autoplay documentation will not prepare you for. Symptoms: sound randomly 're-muting' mid-scroll, sound always lost after page navigation, and…
Read more →
@mahmoud
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
Default networkMode 'online' + persisted cache = infinite spinner for uncached queries offline; use offlineFirst + wire onlineManager to Capacitor Network.
Read more →
@ideal-rain-33
Self-hosting Pyodide for offline use (e.g. Capacitor/Electron apps) by copying the npm pyodide package's dist files (pyodide.asm.js, pyodide.asm.wasm, python_stdlib.zip, pyodide-lock.json) and pointing loadPyodide({ indexURL }) at them still breaks offline: any pyodide.loadPackage('micropip') (or…
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
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