debug:vue
Debug Vue.js 3 application issues systematically. This skill helps diagnose and resolve Vue-specific problems including reactivity failures with ref/reactive, component update issues, Pinia store state management problems, computed property caching bugs, Teleport/Suspense rendering issues, and SSR hydration mismatches. Provides Vue DevTools usage, console debugging techniques, Vite dev server troubleshooting, and vue-tsc type checking guidance.
What this skill does
# Vue.js Debugging Guide
A systematic approach to debugging Vue.js 3 applications, covering common error patterns, debugging tools, and resolution strategies.
## Common Error Patterns
### 1. Reactivity Not Working
**Symptoms:**
- Data changes but UI does not update
- Computed properties return stale values
- Watch callbacks not firing
**Common Causes:**
```javascript
// WRONG: Adding new properties to reactive object
const state = reactive({ count: 0 })
state.newProp = 'value' // Not reactive in Vue 2, works in Vue 3 with Proxy
// WRONG: Destructuring reactive objects
const { count } = reactive({ count: 0 }) // count is NOT reactive
// WRONG: Replacing entire reactive object
let state = reactive({ count: 0 })
state = reactive({ count: 1 }) // Lost reactivity connection
// WRONG: Using ref without .value
const count = ref(0)
count = 5 // Wrong! Use count.value = 5
```
**Solutions:**
```javascript
// Use toRefs for destructuring
const state = reactive({ count: 0 })
const { count } = toRefs(state) // count.value is reactive
// Use ref for primitives
const count = ref(0)
count.value++ // Correct
// Use shallowRef for large objects that don't need deep reactivity
const largeData = shallowRef({ /* big object */ })
// Force reactivity update
import { triggerRef } from 'vue'
triggerRef(myShallowRef)
```
### 2. Component Not Updating
**Symptoms:**
- Props change but component doesn't re-render
- Parent state updates don't propagate to children
- v-for lists don't update correctly
**Debugging Steps:**
```javascript
// 1. Check if prop is reactive
watch(() => props.myProp, (newVal) => {
console.log('Prop changed:', newVal)
}, { immediate: true })
// 2. Verify key attribute on v-for
<template>
<!-- WRONG: index as key for dynamic lists -->
<div v-for="(item, index) in items" :key="index">
<!-- CORRECT: unique identifier -->
<div v-for="item in items" :key="item.id">
</template>
// 3. Check for prop mutation (anti-pattern)
// Props should be immutable - emit events instead
emit('update:modelValue', newValue)
```
### 3. Pinia Store Issues
**Symptoms:**
- Store state not updating across components
- Actions not triggering reactivity
- Getters returning stale data
**Common Problems:**
```javascript
// WRONG: Destructuring store state
const store = useMyStore()
const { count } = store // NOT reactive!
// CORRECT: Use storeToRefs
const store = useMyStore()
const { count } = storeToRefs(store) // Reactive
// WRONG: Mutating state directly outside actions
store.count++ // Works but bypasses devtools tracking
// CORRECT: Use actions or $patch
store.increment() // Action
store.$patch({ count: store.count + 1 }) // $patch
```
**Debugging Pinia:**
```javascript
// Enable Pinia devtools tracking
import { createPinia } from 'pinia'
const pinia = createPinia()
// Subscribe to state changes
store.$subscribe((mutation, state) => {
console.log('Mutation:', mutation.type, mutation.storeId)
console.log('New state:', state)
})
// Subscribe to actions
store.$onAction(({ name, args, after, onError }) => {
console.log(`Action ${name} called with:`, args)
after((result) => console.log(`${name} returned:`, result))
onError((error) => console.error(`${name} failed:`, error))
})
```
### 4. Computed Property Caching Issues
**Symptoms:**
- Computed returns same value despite dependency changes
- Infinite loops in computed properties
- Performance issues with computed
**Solutions:**
```javascript
// Check dependencies are reactive
const computed1 = computed(() => {
// This won't update if nonReactiveValue changes
return someRef.value + nonReactiveValue
})
// Avoid side effects in computed
// WRONG:
const bad = computed(() => {
someRef.value = 'changed' // Side effect!
return otherRef.value
})
// Debug computed dependencies
const myComputed = computed(() => {
console.log('Computed recalculating...')
return expensiveOperation(dep1.value, dep2.value)
})
```
### 5. Teleport/Suspense Issues
**Teleport Problems:**
```html
<!-- Ensure target exists before Teleport mounts -->
<template>
<!-- WRONG: target might not exist -->
<Teleport to="#modal-container">
<Modal />
</Teleport>
<!-- CORRECT: conditional render -->
<Teleport v-if="isMounted" to="#modal-container">
<Modal />
</Teleport>
</template>
<script setup>
import { ref, onMounted } from 'vue'
const isMounted = ref(false)
onMounted(() => { isMounted.value = true })
</script>
```
**Suspense Problems:**
```html
<!-- Handle errors in Suspense -->
<template>
<Suspense>
<template #default>
<AsyncComponent />
</template>
<template #fallback>
<LoadingSpinner />
</template>
</Suspense>
</template>
<script setup>
import { onErrorCaptured, ref } from 'vue'
const error = ref(null)
onErrorCaptured((err) => {
error.value = err
return false // Stop propagation
})
</script>
```
### 6. SSR Hydration Mismatches
**Symptoms:**
- Console warning: "Hydration mismatch"
- Content flickers on page load
- Different content between server and client
**Common Causes and Solutions:**
```javascript
// WRONG: Browser-only code in setup
const width = window.innerWidth // Fails on server
// CORRECT: Use onMounted for browser APIs
const width = ref(0)
onMounted(() => {
width.value = window.innerWidth
})
// CORRECT: Use ClientOnly component (Nuxt)
<template>
<ClientOnly>
<BrowserOnlyComponent />
</ClientOnly>
</template>
// Check for SSR vs client
const isClient = typeof window !== 'undefined'
// Use useId() for consistent IDs
import { useId } from 'vue'
const id = useId() // Same on server and client
```
## Debugging Tools
### Vue DevTools
**Installation:**
- Chrome: [Vue.js devtools](https://chrome.google.com/webstore/detail/vuejs-devtools/)
- Firefox: [Vue.js devtools](https://addons.mozilla.org/en-US/firefox/addon/vue-js-devtools/)
**Key Features:**
1. **Components Tab**: Inspect component hierarchy, props, data, computed
2. **Pinia Tab**: View store state, actions, mutations
3. **Timeline Tab**: Track events, mutations, and performance
4. **Routes Tab**: Debug Vue Router (if using)
**DevTools Tips:**
```javascript
// Access component instance in console
// Select component in DevTools, then in console:
$vm // Current component instance
$vm.someMethod() // Call methods
$vm.someData // Access data
// Inspect from DOM element
// Right-click element > Inspect > Console:
$0.__vueParentComponent // Parent component
```
### Console Debugging
```javascript
// Strategic console.log placement
export default {
setup() {
const state = reactive({ count: 0 })
// Log reactive state changes
watch(
() => ({ ...state }),
(newState, oldState) => {
console.log('State changed:', { old: oldState, new: newState })
},
{ deep: true }
)
return { state }
}
}
// Use console.table for arrays/objects
console.table(items.value)
// Use console.trace for call stack
function problematicFunction() {
console.trace('Called from:')
}
// Group related logs
console.group('Component Mount')
console.log('Props:', props)
console.log('State:', state)
console.groupEnd()
```
### Debugger Statement
```javascript
// Pause at specific points
function handleClick() {
debugger // Execution pauses here
// Inspect scope, call stack, evaluate expressions
processData()
}
// Conditional debugging
watch(count, (val) => {
if (val > 10) {
debugger // Only pause when condition met
}
})
```
### Vite Dev Server
```bash
# Enable verbose logging
vite --debug
# Check for HMR issues
vite --force # Clear cache
# Common vite.config.js debugging options
export default defineConfig({
server: {
hmr: {
overlay: true // Show errors as overlay
}
},
build: {
sourcemap: true // Enable source maps
}
})
```
### vue-tsc Type Checking
```bash
# Run type checking
npx vue-tsc --noEmit
# Watch mode
npx vue-tsc --noEmit --watch
# Check specific files
npx vue-tsc --noEmRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.