---
name: vue-component-debugger
description: "Pins down why a Vue component renders wrong, stops updating, or skips a lifecycle hook, with reproduction steps, a checklist ordered by likelihood, and concrete fixes for your Vue version and libraries. Use when a Vue component renders wrong, its data stops updating, a lifecycle hook never fires, or an event never reaches the parent. Do not use for performance profiling, debugging a Svelte or React component, or restructuring a component that works. Related topics: coding, vue."
---

# Vue Component Debugger

Pins down why a Vue component renders wrong, stops updating, or skips a lifecycle hook, with reproduction steps, a checklist ordered by likelihood, and concrete fixes for your Vue version and libraries.

## When to use

Use this skill when a Vue component renders wrong, its data stops updating, a lifecycle hook never fires, or an event never reaches the parent. Do not use it for performance profiling, debugging a Svelte or React component, or restructuring a component that works.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. Map the reported symptom to the version-specific suspects (reactivity loss, hook names, emit casing, async timing) and list them.
3. Check the pasted code and snapshot against each suspect and mark which ones the evidence supports or rules out.
4. Write reproduction steps that start from a clean page and end at the observed behaviour.
5. Order the checklist by likelihood for this symptom with what each check reveals, then give the fix as changed lines.
6. State whether the fix also applies to the other Vue version and to the listed store or UI library.

## Inputs

- **Component name** (free text, e.g. "OrderTable")
- **File path** (free text, e.g. "src/components/OrderTable.vue")
- **Vue version** (choose one: Vue 3 script setup, Vue 3 Options API, Vue 2.7, Vue 2.6 or older)
- **What goes wrong** (longer free text)
- **Error type** (choose one: Render error, Data not updating, Lifecycle hook not firing, Event handling issue, Prop or emit mismatch)
- **Component code** (longer free text)
- **Props or state snapshot** (longer free text)
- **Related libraries** (choose any: Vuex, Pinia, Vue Router, Vuetify, Element Plus, None)
- **Inspect the store** (choose one: Yes, No)

## Output

A markdown document with Summary, Reproduction Steps, Debugging Checklist ordered by likelihood, and Suggested Fixes as code blocks, in that order.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### Vue Component Debugger

Diagnose the component problem below and give me the fix.

- Component name: {{Component name}}
- File path: {{File path}}
- Vue version: {{Vue version}}
- What goes wrong: {{What goes wrong}}
- Error type: {{Error type}}
- Component code: {{Component code}}
- Props or state snapshot: {{Props or state snapshot}}
- Related libraries: {{Related libraries}}
- Inspect the store: {{Inspect the store}}

Match the symptom to the usual suspects for the version first. Data not updating: a destructured reactive object losing reactivity, a ref used in the template without .value in script, a new array index or property added without reactivity on Vue 2, or a prop mutated locally. Render errors: a template referencing something not returned from setup or not in data, or an async value used before it resolves. Lifecycle hooks: wrong hook name for the version (mounted versus onMounted), or a hook registered inside a callback. Events: emitting a name the parent listens to in a different case, or a .native modifier on Vue 3. When the store is included, check whether the component reads state through a getter or storeToRefs rather than destructuring.

Give reproduction steps a colleague can follow from a clean page. Order the checklist from most to least likely for this symptom and say what each check would show. Then give the fix as a code diff, and state whether it also applies to the other Vue version.

### Output
Return a markdown document with sections Summary, Reproduction Steps, Debugging Checklist (ordered by likelihood with what each check reveals), and Suggested Fixes (code blocks with the changed lines), in that order.

## Pitfalls

- Suggesting Vue 3 fixes such as reactive() for a Vue 2.6 codebase where Vue.set is the actual remedy.
- Blaming the store when the component destructures it and loses reactivity at the component boundary.
- Giving a checklist with no expected result per item, so the developer cannot tell when a check has cleared a suspect.
