Vite OverlayIntroduction

Introduction

Error overlay for Vite with enhanced stack traces and source maps

Last updated:

@visulima/vite-overlay

Enhanced error overlay for Vite with beautiful stack traces, source map support, and better error formatting.

Key Features

  • Enhanced Stack Traces - Clear, readable error stacks with source map resolution
  • Source Map Support - Accurate file locations pointing to your original source files
  • Cause Chain Display - Full error cause chains rendered in the overlay
  • Solution Suggestions - Actionable hints to help resolve common errors
  • Balloon Notification - Compact floating badge when the overlay is dismissed
  • SSR Error Enhancement - Improved server-side error display with file context
  • Framework Detection - Automatic React and Vue error formatting
  • Dark/Light Mode - Follows system theme preference

Installation

npm install @visulima/vite-overlay

Basic Usage

// vite.config.ts
import { defineConfig } from "vite";
import visulimaViteOverlay from "@visulima/vite-overlay";

export default defineConfig({
    plugins: [visulimaViteOverlay()],
});

Configuration

visulimaViteOverlay({
    // Forward client runtime errors to the terminal (default: true)
    forwardConsole: true,

    // Console methods to intercept (default: ["error"])
    forwardedConsoleMethods: ["error", "warn"],

    // Overlay UI customization
    overlay: {
        balloon: {
            // Show/hide the floating balloon button (default: true)
            enabled: true,
            // Balloon position (default: "bottom-right")
            position: "bottom-right",
            // Custom inline style for the balloon
            style: "",
            // Custom SVG icon for the balloon
            icon: "",
        },
        // Inject custom CSS into the overlay
        customCSS: "",
    },

    // Custom solution finders
    solutionFinders: [],
});
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues