Remove calls to undefined ym()
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 fromsrc/lib/CallToAction.svelteandsrc/lib/SharePostLink.svelte - If analytics goals are wanted in the bootstrap, add a tiny
track(goal)helper in#libthat no-ops when no provider is configured - Drop the global
ymdeclaration fromsrc/app.d.ts
Read next
