Skip to content
ExponaBLOG
VUE.JS & NUXT · DAY 088 / 100

Nuxt DevTools: what every Vue & Nuxt developer should know

See inside your Nuxt app.

Expona Admin6 min read

Introduction

Debugging a Nuxt application in production or during development becomes dramatically easier when you understand what's happening inside your app. Nuxt DevTools: what every Vue & Nuxt developer should know covers a powerful browser extension that gives you visibility into pages, components, state, modules, and hooks—without leaving your dev environment.

Over the past 88 days of building with Vue and Nuxt, you've learned routing, component architecture, and state management. Now it's time to master the tools that let you see exactly what your application is doing under the hood.

Pages, components and imports

One of the most valuable features of Nuxt DevTools is the ability to inspect your file structure and component hierarchy in real time. When you're working in a large codebase with dozens of pages and hundreds of components, losing track of where things live becomes a genuine productivity drain.

Open Nuxt DevTools using Shift + Alt + D in your browser, then navigate to the "Pages" tab. You'll see every route in your application as it's defined in the app/pages directory. This shows you:

  • Exact file paths matching your route structure
  • Route parameters and dynamic segments
  • Which components are being used on each page
  • Import order and dependency relationships

For example, if you have a Nuxt app with an e-commerce structure like this:

typescript
app/
  pages/
    index.vue
    products/
      [id].vue
      [id]/
        reviews.vue

DevTools will display each route and show you exactly how the file system maps to your routing table. Click into a page entry and you'll see every component rendered on that page, along with their import paths. This is invaluable when debugging layout issues or understanding why a component isn't appearing where you expect.

The "Components" tab goes deeper. It shows your entire component registry—both auto-imported components and those you've manually imported. You can search by name, see which pages use which components, and trace circular dependencies. If you suspect a component is being shadowed or imported from an unexpected location, DevTools will show you exactly what's being loaded.

Payload and state inspection

State management is where things get tricky in complex applications. Whether you're using Pinia, Nuxt's built-in useState, or legacy Vuex patterns, DevTools gives you a window into the actual data flowing through your app at any moment.

Navigate to the "Payload" tab to see the server-side rendered data that was sent to the client. This is particularly useful for debugging hydration mismatches—those frustrating cases where your server renders one thing and the client renders another. You can inspect:

  • Initial state passed from server to client
  • Preloaded data from useAsyncData or useFetch
  • Cache state
  • Timing information for async operations

Here's a practical scenario: you're building a SaaS dashboard where user permissions are fetched on the server. Your page works fine in development but shows a permission error in production. Open DevTools, check the Payload tab, and you'll immediately see whether the permissions object was actually serialized and sent to the client or if it got lost during hydration.

For Pinia state inspection, DevTools integrates directly with your stores. Under the "State" tab, you can:

  • View the current value of every store
  • Watch state changes in real time as users interact with your app
  • Time-travel debugging to see how state evolved
  • Trigger actions manually to test state mutations

This code defines a typical Pinia store for a ride-hailing app:

typescript
export const useRideStore = defineStore('ride', () => {
  const currentRide = ref(null)
  const rides = ref([])
  const loading = ref(false)
  
  const fetchRides = async () => {
    loading.value = true
    const data = await $fetch('/api/rides')
    rides.value = data
    loading.value = false
  }
  
  return { currentRide, rides, loading, fetchRides }
})

With DevTools open, you'll see each of these reactive values update instantly as the component triggers fetchRides(). You can pause on a specific state change and inspect what led to it—far more efficient than console.log statements scattered throughout your code.

Module and hook timing

Nuxt's module system and hook lifecycle can feel like a black box. Modules run at build time and runtime, hooks fire in a specific order, and when something goes wrong, figuring out which module or hook caused it requires detective work. DevTools eliminates this guesswork.

The "Timeline" or "Modules" tab (depending on your DevTools version) shows you:

  • Every module that loaded and in what order
  • Hooks that fired during app initialization
  • Timing information for each hook execution
  • Any errors or warnings modules emitted

Imagine you've installed three new Nuxt modules to add authentication, analytics, and image optimization. Your app suddenly boots 40% slower. Rather than removing modules one by one, open DevTools and look at the Timeline. You'll see exactly which module is taking 3 seconds to initialize. Often it's a module making external API calls that shouldn't happen during setup, or a build-time hook doing unnecessary work on every hot reload.

Here's an example of a module that uses hooks:

typescript
export default defineNuxtModule({
  meta: {
    name: 'custom-auth',
    configKey: 'auth'
  },
  setup(options, nuxt) {
    nuxt.hook('app:created', () => {
      console.log('App created')
    })
    
    nuxt.hook('app:beforeMount', () => {
      // Validate auth token
    })
    
    nuxt.hook('app:mounted', () => {
      // Refresh user session
    }
  }
})

DevTools will show you when each hook fired relative to other modules, allowing you to identify timing conflicts. If your custom auth module tries to access the router before the pages module has finished setting it up, DevTools will show you the order of execution and help you spot the problem.

Opening Nuxt DevTools

Installation is straightforward. Nuxt DevTools comes built-in with Nuxt 3.1+, so you likely already have it. If you don't, run:

typescript
npm install -D @nuxt/devtools

Then press Shift + Alt + D in any running Nuxt dev server. A panel opens at the bottom of your browser showing tabs for Pages, Components, Payload, Timeline, Modules, and more. It works in development mode only—it won't appear in production builds.

You can also right-click on any component in the DOM and select "Inspect Nuxt Component" to jump directly to that component's source code in your editor (if configured). This is especially useful in complex nested component trees.

Common mistakes

Relying on DevTools instead of understanding your code structure: DevTools is a lens, not a replacement for knowing your app. Use it to verify your understanding, not to avoid learning how Nuxt works.

Forgetting DevTools only works in development: You can't use Shift + Alt + D in production to debug a live issue. Use DevTools during development to build mental models you can apply when debugging production problems.

Not clearing state between tests: If you're testing different state scenarios, remember that DevTools shows live state. Refresh the page or manually reset stores to start fresh—stale state from a previous test can mislead you.

Ignoring the Timeline when performance degrades: Many developers reach for profiling tools immediately. Often, a glance at the Timeline tab reveals that a module or hook is simply doing too much work. Start there before diving into flame graphs.

Key takeaways

  • Use Shift + Alt + D to open Nuxt DevTools in any development environment
  • The Pages and Components tabs show your entire app structure and where things are imported from
  • Payload inspection catches hydration mismatches before they reach production
  • State tabs in DevTools let you watch Pinia stores and other reactive data change in real time
  • The Timeline reveals which modules and hooks are consuming the most time during startup
  • DevTools works in development only—use it to build understanding you can apply everywhere
  • Combine DevTools with your editor's "Go to Definition" features for a complete debugging workflow
ShareXLinkedInReddit

Found this useful? Support the writing.

Buy me a coffee
Written by
Expona Admin
Site administrator

Comments

Loading comments…

Leave a comment

Comments are reviewed before they appear. Be kind and stay on topic.

Related articles