npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@whatitbroke/vue

v1.0.4

Published

Vue 3 adapter, error handler plugin, and reactive state debugger for WhatItBroke

Readme

@whatitbroke/vue

Vue 3 Adapter, Error Handler Plugin, Component State Inspector, and Reactivity Loss Analyzer

npm version License: MIT

@whatitbroke/vue integrates directly into Vue 3's error and warning lifecycle to trace component hierarchies, setup state, lifecycle hook failures, and reactive prop destructuring bugs. Includes a zero-config, in-page diagnostics HUD powered by Shadow DOM.


Installation

npm install @whatitbroke/vue @whatitbroke/core @whatitbroke/shared

Zero Configuration Required: Pure browser-native ESM. Works out of the box in modern Vite, Webpack, Nuxt, and Vitest without any optimizeDeps workarounds or index.html polyfills.


Quickstart (Vue 3 Plugin)

In your main.ts or main.js:

import { createApp } from 'vue';
import App from './App.vue';
import { WhatItBrokeVue } from '@whatitbroke/vue';

const app = createApp(App);

// Install WhatItBroke Vue plugin
app.use(WhatItBrokeVue, {
  // In-Page Diagnostics HUD (Floating Badge & Diagnostic Modal)
  overlay: true,                     // default: true in browser
  overlayPosition: 'bottom-right',   // 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
  autoOpenOnCrash: true,             // Automatically expand popup on error (default: true)

  // Vue Diagnostics & Warning Hooks
  captureReactivityLoss: true,       // Intercepts mutating readonly props & broken refs
  captureComponentStack: true,       // Traverses full parent-to-child hierarchy

  // Optional Handlers
  onError: (report, error) => {
    console.error('WhatItBroke Diagnostic Report:', report);
  },
  customErrorHandler: (err, instance, info) => {
    // Automatically chained
  }
});

app.mount('#app');

Key Features

1. In-Page Diagnostics HUD (Shadow DOM)

When an error occurs, WhatItBroke renders a floating status badge and an interactive diagnostic popup directly on the page:

  • Zero Style Leakage: Encapsulated in an isolated Shadow DOM (mode: 'open') with :host { all: initial }. WhatItBroke styles cannot leak into your application, and your app's styles (Tailwind, Bootstrap, resets) cannot distort the HUD.
  • Root Cause & Unified Patch: Displays "Why it broke" and the recommended fix with code diff.
  • Component Breadcrumb: Displays true component hierarchy (App > Dashboard > JobTracker).
  • Interactive State Inspector: Inspect active component props and setupState.

2. Vue Reactivity Loss Detection

Destructuring props in <script setup> breaks Vue 3 reactivity tracking. WhatItBroke flags this destructuring and warns before fatal dereferences occur:

<!-- ❌ Reactivity Broken -->
<script setup lang="ts">
const props = defineProps<{ items: string[] }>();
// WhatItBroke flags this destructuring and provides a patch:
const { items } = props; 
</script>

Recommended Patch Generated by WhatItBroke:

- const { items } = props;
+ const { items } = toRefs(props);

3. Component Hierarchy Inspection

When an error occurs during template rendering or lifecycle hooks (onMounted, onUpdated), WhatItBroke walks instance.parent to extract the full component hierarchy:

['App', 'Dashboard', 'JobTracker', 'ErrorLab']

4. Programmatic Vue Adapter

import { VueAdapter } from '@whatitbroke/vue';
import { WhatItBrokeCore } from '@whatitbroke/core';

const core = new WhatItBrokeCore();
const adapter = new VueAdapter(core);

// Hook into any caught error:
const report = await adapter.handleVueError(error, componentInstance, 'render function');
console.log(report.rootCause);

Zero-Bloat Guarantee

@whatitbroke/vue is less than 5 kB gzipped. It contains 0% React, 0% Angular, and 0% Node.js server dependencies. vue is specified as an optional peerDependency.

License

MIT © WhatItBroke Team