# vue-error-boundary-kit — AI Reference Production-ready error boundaries for Vue 3: a declarative `` component (`onErrorCaptured`-based) + `useErrorBoundary()` composable for errors Vue's own lifecycle can't see, adapter-based error reporting (Sentry/Bugsnag/LogRocket/OTel/HTTP/console — all structurally-typed, none are real dependencies), retry with exponential backoff, an in-memory error history/debug panel, breadcrumbs, rate-limiting/dedup, a Nuxt module, and integrations for vue-router and @tanstack/vue-query. Version 0.3.4. Vue-only (no React/vanilla build) — unscoped package name (not `@macrulez/...`). This document is hand-written for AI agents and other tools that generate code against this package: every signature, default, and behavior note below is verified directly against the TypeScript source (not summarized from prose docs). For human-readable narrative docs, see the interactive site instead: - Full docs (EN): https://npm.vuecraft.ru/en/packages/vue-error-boundary-kit/guide/overview - Full docs (RU): https://npm.vuecraft.ru/packages/vue-error-boundary-kit/guide/overview - GitHub: https://github.com/macrulezru/vue-error-boundary-kit - npm: https://www.npmjs.com/package/vue-error-boundary-kit Links below starting with "/" are relative to https://npm.vuecraft.ru. --- ## 1. Package map | Import path | Contains | |---|---| | `vue-error-boundary-kit` | `ErrorBoundary`, `useErrorBoundary`, every shared type (section 2–4). | | `vue-error-boundary-kit/global-capture` | `useGlobalErrorCapture()` — window `error`/`unhandledrejection` (section 6). | | `vue-error-boundary-kit/async-boundary` | `AsyncBoundary` — `ErrorBoundary` + `Suspense` composed (section 5). | | `vue-error-boundary-kit/router` | `useRouterErrorBoundary()` — vue-router `onError()` (section 7). | | `vue-error-boundary-kit/tanstack-query` | `useQueryErrorReset()` — resets errored `@tanstack/vue-query` queries (section 8). | | `vue-error-boundary-kit/retry-backoff` | `createBackoffRetry()` — exponential-backoff wrapper around a boundary's `retry()` (section 9). | | `vue-error-boundary-kit/devtools` | `createErrorHistory()`, `ErrorHistoryPanel` — in-memory debug log (section 10). | | `vue-error-boundary-kit/testing` | Throw-fixture components + test doubles, framework-agnostic (section 11). | | `vue-error-boundary-kit/adapters/console` | `createConsoleReporter`, `consoleReporter` singleton (section 12.1). | | `vue-error-boundary-kit/adapters/http` | `createHttpReporter()` — batched POST + `sendBeacon` on pagehide (12.2). | | `vue-error-boundary-kit/adapters/sentry` | `createSentryReporter()` — wraps an already-initialized Sentry client (12.3). | | `vue-error-boundary-kit/adapters/bugsnag` | `createBugsnagReporter()` (12.4). | | `vue-error-boundary-kit/adapters/logrocket` | `createLogRocketReporter()` (12.5). | | `vue-error-boundary-kit/adapters/otel` | `createOtelReporter()` (12.6). | | `vue-error-boundary-kit/adapters/rate-limit` | `createRateLimitedReporter()` — dedup + rate-limit wrapper around any reporter(s) (section 13). | | `vue-error-boundary-kit/adapters/breadcrumbs` | `createBreadcrumbTrail()`, `withBreadcrumbs()` (section 14). | | `vue-error-boundary-kit/nuxt` | Nuxt module default export (section 15). | | `vue-error-boundary-kit/nuxt/runtime` | `useNuxtErrorBoundary()` — catches what escapes every boundary (`vue:error`/`app:error`) (15.3). | **No app-level plugin/install step exists or is needed** — every export above is a plain component/composable/factory function; import what you use directly. `peerDependencies`: only `vue: ^3.4.0` is required. `@nuxt/kit`, `@tanstack/vue-query`, and `vue-router` are all `peerDependenciesMeta.optional: true` — the core (`.` entry) has **zero** runtime dependencies beyond Vue itself. --- ## 2. Core architecture — how capture, isolation, and retry actually work ### 2.1 `CapturedError` — the shape every capture path normalizes to ```ts type CapturedErrorSource = 'render' | 'async' | 'event' | 'unhandledrejection' | 'manual' interface CapturedError { error: unknown // the raw thrown value, untouched message: string // err.message if `err instanceof Error`, else String(err) stack?: string // err.stack if Error, else undefined componentName?: string // type.name ?? type.__name (the latter: