Debugging with Vue DevTools
Installing Vue DevTools as an extension or Vite plugin, then using the component inspector, Pinia and router panels, and the timeline to find bugs.
Debugging with Vue DevTools
The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.
Not started
What you'll learn
- Browser DevTools see the DOM and plain JavaScript; Vue DevTools see the layer in between, the component tree with each component's props, state, computed values, and injections, which is where most Vue bugs live.
- Current Vue DevTools (version 7 onward) runs as a browser extension or as a Vite plugin that adds an in-page panel; it supports Vue 3 only, and Vue 2 apps need the legacy version 6 extension.
- The Components panel lets you pick an element on the page, jump to the component that rendered it, edit its state live, and open its source file in your editor.
- The Pinia and Router panels show store state, getters, current route, and route records, and the Timeline records component events, store actions, route changes, and render timings in order, which answers the question of what happened, and in what order.
- DevTools is disabled in production builds by default; you can turn it on with the __VUE_PROD_DEVTOOLS__ build flag, though that exposes your component internals to anyone using your site.
Why the browser’s own DevTools aren’t enough
Open a Vue app in the browser’s Elements panel and you see divs, buttons, and data-v attributes. Open the Sources panel and you see compiled JavaScript. Neither shows you the thing you actually wrote: a tree of components, each with props, reactive state, computed values, and injected dependencies.
Most Vue bugs live in that middle layer. A prop arrived with the wrong value. A computed didn’t update because something wasn’t reactive. A store action ran twice. A child never received an injected value. You can track all of that with console.log, one guess at a time. Vue DevTools shows it directly.
Installing it
Current Vue DevTools (version 7 onward, now on version 8) comes in two forms:
- A browser extension for Chrome, Edge, and Firefox. Install once, and it appears as a “Vue” tab in your browser’s DevTools on any page running a development build of Vue.
- A Vite plugin that injects DevTools as a floating panel inside your own page. No extension needed, and it adds Vite-specific views. A project scaffolded with
npm create vue@latestcan include it when you opt in:
// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueDevTools from 'vite-plugin-vue-devtools'
export default defineConfig({
plugins: [vue(), vueDevTools()],
})
With the plugin, a small Vue logo appears at the bottom of the page; click it or press Alt/Option + Shift + D to open the panel. For environments where neither works, such as an Electron app or a page on another device, there’s also a standalone app (@vue/devtools).
One compatibility note: version 7 and later support Vue 3 only. If you maintain a Vue 2 app, you need the legacy version 6 extension, and most tutorials from before 2024 show that older interface.
The Components panel: where most debugging happens
The Components panel shows the live component tree. Select a component and you see:
- props it received, and from where
- setup state: refs, reactive objects, and computed values, with their current values
- injected values from
provide/inject - attrs that fell through to the root element
Three features make it faster than reading code:
- The inspector. Click the crosshair, then click anything on the page, and DevTools jumps to the component that rendered it. No more guessing which of forty
Cardcomponents you’re looking at. - Live editing. Change a ref’s value in the panel and the page updates. That’s the fastest way to test “would it work if this value were X?” without touching code.
- Open in editor. Jump from a selected component straight to its
.vuefile in your editor.
A practical way to narrow down a rendering bug: find the component, check its state. If the state is right but the screen is wrong, the problem is in the template or in reactivity, such as a value destructured out of a reactive object that lost its connection. If the state itself is wrong, look at whoever sets it.
Pinia and Router panels
When your app uses Pinia, a Pinia panel lists every store with its state and getters. You can edit state there too, which is handy for putting the app into a hard-to-reach condition, like an expired session or an empty cart, without clicking through the UI.
The Router panel shows the current route (path, params, query, matched records) and the full list of route definitions, which answers “why didn’t this URL match the route I expected?” quickly.
The Timeline: what happened, in what order
Many bugs aren’t about a value being wrong but about events happening in the wrong order, or twice, or not at all. The Timeline records a running log, grouped into layers:
- mouse and keyboard events
- component events (every
emit, with its payload) - Pinia actions and state changes
- route changes from the router
- component performance: when each component rendered and patched, and for how long
Click a button and read the log. Did the submit event fire? Did the store action run once or twice? Did the route change happen before or after the data loaded? The performance layer also connects back to the previous lesson: if one interaction shows hundreds of component renders, you’ve found your unstable prop.
Beyond the panels: Vue’s debugging hooks
DevTools tells you that a component re-rendered. To find out which reactive change caused it, Vue has development-only hooks:
import { onRenderTracked, onRenderTriggered } from 'vue'
onRenderTriggered((event) => {
// event.target, event.key, event.type tell you exactly what changed
console.log('re-render caused by', event.key, event.type)
debugger
})
watch and computed accept similar onTrack and onTrigger options. And setting app.config.performance = true in development makes Vue add its component timings to the browser’s own Performance panel, so you can line them up against network requests and long tasks.
Production builds
Vue’s production build strips the DevTools integration by default, which is why the extension says it can’t inspect most live sites. You can keep it with the __VUE_PROD_DEVTOOLS__ compile-time flag (set it to true in Vite’s define option), but that ships extra code and lets any visitor read your component state, so it’s a decision for staging environments, not public production.
React developers will find this familiar. The Components panel matches React DevTools’ component tree, and the Timeline’s performance layer covers ground similar to the React Profiler.
What the video covers
Mike Møller Nielsen’s May 2026 video is a short screen recording of the vite-plugin-vue-devtools overlay on a Vue 3 app: inspecting component state and reactive data, checking Pinia store changes, looking at routes, and using it to track down why a value isn’t updating. At under seven minutes it is a quick look at what the tool shows, not a full tour. It doesn’t cover the browser extension, the Timeline in depth, the debugging hooks, or production builds; the sections above do.
For how the tool itself is built, the “go deeper” talk has Guillaume Chau, who created Vue DevTools, on the current version and the DevTools SDK, including building a custom Pinia inspector.
Where this fits
Debugging builds on performance optimization and Pinia fundamentals. This closes the “Vue in practice” group. Next, server-side Vue: SSR and hydration in Vue.
Check yourself
A button click should update a total, but the total doesn't change. What would you look at in Vue DevTools, in what order?
First the Timeline, to see whether the click produced the expected component event or store action at all. Then the Components panel, selecting the component that shows the total, to check whether the underlying state changed. If state changed but the DOM didn't, the bug is in rendering (for example a value read without reactivity); if state didn't change, the bug is in the handler or the store action.
What is the difference between the browser extension and the Vite plugin versions of Vue DevTools?
The extension is installed once in your browser and works on any page running a development build of Vue. The Vite plugin is added to a project's vite.config and injects the DevTools as a panel inside the page, which needs no extension and adds Vite-aware tabs such as the module graph and the plugin-inspect view.
Why might Vue DevTools say it can't inspect a site you're looking at in production?
Vue's production build strips the DevTools integration by default to save size and avoid exposing component internals. It is only included if the site was built with the `__VUE_PROD_DEVTOOLS__` flag set to true.
How can you find out which reactive change caused a specific component to re-render?
The Timeline's performance layer shows when and how long each component rendered. To see the exact dependency that triggered a render, add an `onRenderTriggered` hook to that component in development; its callback receives the target object, key, and type of operation that caused the update.
Go deeper
Notes
Notes are saved to your account.
Everything else on this page works without one — progress and bookmarks keep themselves in this browser and come with you when you sign in. Notes are the one thing worth not trusting to a browser you might clear.
Your notes could not be loaded.