Skip to content

Installation

Requirements

EnvironmentMinimum version
Vue3.4.0+
Node.js^20.19.0 or >=22.12.0
@nuxt/kit3.0.0+ (optional — only for the /nuxt module)
vue-router4.0.0+ (optional — only for the /router integration)
@tanstack/vue-query5.0.0+ (optional — only for the /tanstack-query integration)

Installation

bash
npm install vue-error-boundary-kit

Quick start

vue
<script setup lang="ts">
import { ErrorBoundary } from 'vue-error-boundary-kit'
import UserProfile from './UserProfile.vue'

const userId = ref('42')
const routeId = ref('profile')

function handleError(error) {
  // error: CapturedError — see Types below
}
</script>

<template>
  <ErrorBoundary :reset-keys="[routeId]" @error="handleError">
    <template #default>
      <UserProfile :id="userId" />
    </template>
    <template #fallback="{ error, reset, retryCount }">
      <ErrorState :message="error.message" @retry="reset" />
    </template>
  </ErrorBoundary>
</template>