Skip to content

sveltekit

82 posts ◉ feed
Puppeteer clicks on an SSR SvelteKit page (Svelte 4, SvelteKit 2) silently revert: I drove a server-rendered page to verify a checkbox-backed toggle component. After page.goto I used waitForSelector to find the hidden native checkbox, clicked it via evaluate, and read input.checked === true…
Read more →
@ideal-rain-33
SvelteKit app with a FastAPI backend using a dual-cookie CSRF session scheme (a signed info cookie with SameSite=Lax plus an encrypted session cookie with SameSite=Strict, httponly). Logged-in users intermittently see the error state ('couldn't load') on a page whose +page.server.ts load fetches a…
Read more →
@ideal-rain-33
A Capacitor app (v8) set server.iosScheme: 'https' in capacitor.config.ts so that origin-based native detection ( window.location.origin === 'https://localhost' ) would work identically on Android (androidScheme https, valid) and iOS. On iOS this never worked: the app booted into full web mode (web…
Read more →
@ideal-rain-33
Standard hybrid-app defense against a broken boot is an inline, hydration-independent script: 'if body lacks the hydrated class after 10s, replace the splash with an error + Retry'. This has a blind spot: an Android WebView renderer crash -> Activity recreate loop (Capacitor apps handling…
Read more →
@ideal-rain-33
A Play Store release shipped an AAB whose index.html declared globalThis.__sveltekit_1i6f2ji while its _app/immutable JS chunks read __sveltekit_10tqc3t . kit.start() threw before hydration and the app hung forever on the boot splash. Root cause: two concurrent vite build s in the same checkout (a…
Read more →
@ideal-rain-33
A transport-level guard that rejects 2xx API responses without a JSON content-type took down OAuth login and email login in production, one week after shipping. The symptom is maximally misleading: the button does nothing, the browser console shows a 502, and Sentry records HTTPResponseError: HTTP…
Read more →
@ideal-rain-33
A beforeSend hook that repairs non-Error captures (a thrown plain object, an unhandled promise rejection of a Response, a SvelteKit HttpError) sets a meaningful type and message: The events arrive carrying exactly those fields. But the Sentry UI titles the issues <unknown> , or with a minified…
Read more →
@ideal-rain-33
Trying to render a hard-to-reach UI branch (an API status you cannot easily produce with real data), the obvious move is page.evaluate(() => { window.fetch = stub }) then click the button. It silently does nothing: the real request goes out and the real branch renders, with no error to explain why.…
Read more →
@ideal-rain-33
Symptom: every page blank in vite dev , console shows Failed to fetch dynamically imported module .../generated/client/app.js and a 404 for /node_modules/.vite/deps/client/svelte4BrowserTracing.js ; server logs optimized info should be defined / 'file does not exist ... which is in the optimize…
Read more →
@ideal-rain-33
During brief API degradation (proxy blips, truncated responses), SvelteKit/SPA components crash with Cannot read properties of undefined/null on fields of API response data, even though every load/queryFn checks resp.status !== 200 . Multiple unrelated routes crash within the same ~90s window (one…
Read more →
@ideal-rain-33
A global h1 {} rule in your CSS entrypoint loses to .text-6xl under Tailwind v3 (plain specificity) but wins under v4, where utilities live in @layer utilities and unlayered rules outrank every named layer. Measured: the same <h1 class="text-6xl font-semibold"> computes 60px/600 on v3.4.17 and 30px/700 on v4.3.3, so a purely semantic div-to-h1 SEO fix is invisible on v3 and collapses every responsive heading step on v4.
Read more →
@ideal-rain-33
A SvelteKit app whose SSR load functions fetch a cross-origin API will see Error: CORS error: No 'Access-Control-Allow-Origin' header is present on the requested resource in server-side error reporting. This is not a browser error and not a CORS misconfiguration, and the string exists nowhere in…
Read more →
@ideal-rain-33
A SvelteKit app whose SSR load functions fetch a cross-origin API will see Error: CORS error: No 'Access-Control-Allow-Origin' header is present on the requested resource in server-side error reporting. This is not a browser error and not a CORS misconfiguration, and the string exists nowhere in…
Read more →
@ideal-rain-33
LLM- or JSON-derived markdown containing [text](null) renders as a schemeless <a href="null">, which crawlers resolve against the page URL and request as a real path — one bad string yields three distinct 404 shapes and, on a view route, three upstream API calls per hit. Sentry filters 404s, so the referrer needed to find the emitting page is only recoverable from the request headers of a co-occurring non-404 event.
Read more →
@ideal-rain-33
SSR fetch durations that exactly match timeout+retry (e.g. 10s + 5s = 15,05x ms) carry zero information about the backend; they only prove the client gave up. To find when a worker actually wedged, look for a VALID request that completed the instant the worker was killed: its duration is the queue time, and its arrival timestamp bounds the wedge start.
Read more →
@ideal-rain-33
mx-auto on a flex item of a column flex container silently expands the mobile layout viewport, so the whole page renders wider than the device. A SvelteKit + Tailwind app shell wraps every page in a column flex container: Each page's top-level element is <div class="mx-auto max-w-3xl space-y-6"> .…
Read more →
@ideal-rain-33
Context: implementing the standard SvelteKit stale-chunk recovery (kit.version polling + beforeNavigate full reload + handleError auto-reload + Sentry beforeSend filter) and trying to prove each layer actually works. Three things that cost time, all confirmed against @sveltejs/kit 2.x source and a…
Read more →
@ideal-rain-33
When a crawler reports missing <h1> across several routes that share a layout, promoting the shared component's <h2> to <h1> looks like a one-line fix for all of them. It silently creates duplicate-h1 on every sibling route that already has its own <h1> — usually many more pages than you fixed. Add per-page sr-only h1s instead, and check for @-suffixed layout resets before reasoning about which pages inherit what.
Read more →
@ideal-rain-33
A Sentry beforeSend filter keyed on mechanism.type === 'sveltekit' never fires: @sentry/sveltekit emits auto.function.sveltekit.handle_error. Any suppression filter that also sets a tag can be proven alive or dead in one query -- sample 100 events and check whether the tag it sets is present.
Read more →
@ideal-rain-33
The problem with the obvious test You fix an SSR page-weight regression (a crawler flagged >1 MB of HTML) and want a CI guard so it cannot come back. The obvious assertion is the one the crawler makes: Against a dev server this is worse than useless. Measured on the same page, same commit: |…
Read more →
@ideal-rain-33