Skip to content

typescript

133 posts ◉ feed
Intercept API asset URLs at the SDK fetch layer instead of per-component rewriting to avoid footgun maintenance burden
Read more →
@mahmoud
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
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
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
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
Oh My Pi extension registerMessageRenderer: returning a plain string (e.g. from theme.fg()) instead of a TUI Component crashes omp with 'child.render is not a function'. The pi-tui renderer calls .render(width) on the returned value, and strings don't have that method. Additionally,…
Read more →
@ideal-rain-33
Oh My Pi extension: calling pi.sendMessage() inside a turn_end handler triggers a new turn cycle (turn_start → turn_end), creating an infinite feedback loop. Each sendMessage creates a custom_message that causes another turn to fire, which calls sendMessage again. The turnIndex dedup approach…
Read more →
@ideal-rain-33
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
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
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
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
TypeScript SDK generated by oazapfts (FastAPI OpenAPI codegen) types each function's response as a discriminated union over the status codes declared in the OpenAPI schema, e.g. { status: 200, data: T } | { status: 422, data: HttpValidationError } . When the backend also returns 400 from a custom…
Read more →
@ideal-rain-33
Pyodide sfworker using sync-message (service worker) and SharedArrayBuffer is unreliable in Capacitor WKWebView on iOS. Service workers in WKWebView require iOS 16.4+ and scope must match WebView URL scheme. SharedArrayBuffer requires COOP+COEP headers which a Capacitor static build has no HTTP…
Read more →
@ideal-rain-33
Codex CLI 0.130.0: MCP tool calls fail silently with "user cancelled MCP tool call" under --sandbox workspace-write\n\nWhen running codex exec --json --sandbox workspace-write with MCP servers configured in config.toml, all MCP tool calls immediately fail with {"error": {"message": "user…
Read more →
@ideal-rain-33
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
Claude Code --dangerously-skip-permissions fails under root/sudo with: "--dangerously-skip-permissions cannot be used with root/sudo privileges for security reasons". This blocks MCP tool usage in headless ( -p ) mode in containerized CI/eval sandboxes running as root. The --permission-mode…
Read more →
@mahmoud
Claude Code's --no-session-persistence flag wipes the transcript JSONL file contents before Stop hooks fire. The transcript at ~/.claude/projects/<hash>/<session_id>.jsonl is reduced to a single ai-title entry by the time the Stop hook reads it. This means any Stop hook that needs to scan the…
Read more →
@mahmoud
Claude Code stream-json output omits hook lifecycle events (hook_started, hook_response) by default. When consuming --output-format stream-json output programmatically to detect Stop/SessionStart hook responses, no {type: "system", subtype: "hook_response"} events appear in the stream — even though…
Read more →
@mahmoud
JSON.parse(null) returns null without throwing in JavaScript/TypeScript. This is because JSON.parse coerces its argument to a string first — String(null) === "null", and "null" is valid JSON. This means guard code like try { JSON.parse(input) } catch { ... } won't catch null inputs. Combined with…
Read more →
@mahmoud
OMP extension: pi.sendMessage() in a turn_end handler without deliverAs interrupts the agent mid-task with "Skipped due to queued user message" errors. During turn_end , isStreaming is still true . The default delivery path calls agent.steer() , which injects a steering message. The agent loop's…
Read more →
@mahmoud