debugsy 26.11.7 · React 19 · PolyForm Perimeter 1.0.1

A React debug panel that runs inside your app

debugsy is a React debug panel you mount in your own app: one ordered log of your debug messages, the changed values you track and render-count warnings.

~/your-appdebugsy 26.11.7
npm i @n-uf/debugsy

# then mount <DebugsyLook /> from a client component

The panel below is live

session auth expired {"ttl":0}

refresh auth 5xx {"status":503}

refresh auth renewed {"expiresIn":3600}

session auth synced {"userId":42}

Sample log

What the panel shows

One log inside your app

Your debug messages, changed values and render-count warnings in one ordered, virtualised log, in the page you're debugging.

const debug = useDebugsy()
debug.log("session", "synced", { userId })
dsy.warn("session", "expired", { ttl })
getDebugsy().error("refresh", "5xx", err)

Which value changed

With Deps switched on, useWhyDidYouUpdate compares the values you pass with the previous render and logs each key that changed, with its old and new value.

useWhyDidYouUpdate("Form", { values, errors, onSubmit })

Render count warnings

With Deps on (and trackRenders: true in 26.11), useRenderTracker warns when a component reaches its render threshold and calls your callback. It doesn't stop renders.

useRenderTracker("Modal", {
  trackRenders: true,    // needed in 26.11
  renderThreshold: 10,   // default
  onExcessiveRenders: (info) => debug.warn("performance", "hot", info),
})

Install

  1. Add the package

    $ npm i @n-uf/debugsy

    Needs React 19 (react and react-dom are peer dependencies).

  2. Mount the panel

    "use client";
    
    import { DebugsyLook } from "@n-uf/debugsy";
    
    export function DebugPanel() {
      return <DebugsyLook />;
    }

    Mount <DebugsyLook /> from a client component. That's the whole setup: no CSS import, no Tailwind, no bundler config.

  3. Keep it out of production

    if (process.env.NODE_ENV !== "production") {
      await import("@n-uf/debugsy")
    }

    It doesn't remove itself: load it only in development to keep it out of production builds.

Questions

What is a React debug panel?

A React debug panel is a panel inside your running app that shows what your components are doing. debugsy is one: you mount it in your own app, and it shows one ordered, virtualised log of your debug messages, the changed values you track and render-count warnings, in the page you're debugging.

How do I add a debug panel to a React app?

Install the package with npm i @n-uf/debugsy, then mount <DebugsyLook /> from a client component. That's the whole setup: no CSS import, no Tailwind and no bundler config. It needs React 19. Press ⌘+D (Ctrl+D) to show the panel and Esc to close it.

How do I keep a React debug panel out of production?

Load it only in development. debugsy doesn't remove itself, so import it behind a NODE_ENV check to keep it out of production builds. Its console command, window.debugsy, is also left off in production builds. It makes no network requests and sends no telemetry, and its settings stay in localStorage.

How can I see why a React component re-rendered?

Use useWhyDidYouUpdate. With Deps switched on, it compares the values you pass with the previous render and logs each key that changed, with its old and new value. useRenderTracker adds a warning when a component reaches its render threshold, and it calls your callback. It doesn't stop renders.

Does debugsy work with Next.js, Vite and Tailwind?

Yes. debugsy works in the Next.js App Router, in Vite and in other React 19 apps. It is client only, so import it from client components. The panel renders its own scoped stylesheet, so it looks the same in a Tailwind app and a plain one, and your app's CSS doesn't leak into it.