Nostics

Errors worth reading

nostics helps library authors replace ad hoc error strings with stable codes, actionable fixes, docs links, and structured Diagnostic objects.

[NUXT_B2011] Plugin `./runtime/analytics.server.ts` has mode `client`.
├▶ fix: Rename the file or register it with mode `server`.
├▶ sources: modules/analytics.ts:18:5
╰▶ see: https://nuxt.com/e/b2011
What it gives you
    Stable codes
    Give every known problem a permanent code like NUXT_B2011. Users can search it, docs can link to it, and your wording can improve without breaking the identifier.
    Actionable fixes
    Put the next step next to the error. The default formatter renders the message, fix, source locations, and docs URL in one compact block.
    Typed params
    Use functions for dynamic messages and fixes. TypeScript requires the right params wherever you report the diagnostic.
    Reporters
    Log to the console, append NDJSON to a file, POST to an endpoint, or write your own reporter.
    Production stripping
    Use the build plugin to remove report-only diagnostics and their catalog text from production bundles.
    Vite dev collection
    Forward browser diagnostics to a local log file during Vite dev when the browser console is not enough.
Start here
    Quick start
    Install the package, define two codes, and report your first diagnostic.
    Guide
    Learn the catalog shape, params, docs URLs, sources, causes, reporters, and build plugins.
    API reference
    Check imports, option names, reporter signatures, formatter shapes, and plugin options.
Copyright © 2026