typeof ym is 'undefined' on production. Clicking the CTA button or the share link executes ym(34795480, 'reachGoal', ...) and throws before the handler finishes. Navigation still happens, but the copy-to-clipboard branch in SharePostLink runs after the throw and never executes.

Extract hardcoded config values tracks moving the counter ID into config; this todo is about the runtime error itself.

Tasks

  • Remove the ym() calls from src/lib/CallToAction.svelte and src/lib/SharePostLink.svelte
  • If analytics goals are wanted in the bootstrap, add a tiny track(goal) helper in #lib that no-ops when no provider is configured
  • Drop the global ym declaration from src/app.d.ts

No errors on click

Analytics should be opt-in, not a leftover

A static site template built with SvelteKit.

Sveleton, 2025