Skip to content

Releases: poppinss/youch

Update dependencies

28 Mar 07:11

Choose a tag to compare

4.1.1 (2026-03-28)

What's Changed

  • chore(deps): update cookie-es to v3 by @pi0 in #88

Full Changelog: v4.1.0...v4.1.1

Tag as latest after a stable beta being tested for more than a year

24 Feb 15:30

Choose a tag to compare

4.1.0 (2026-02-24)

Breaking Changes

  • Switch from CommonJS to ESM. The package can no longer be require()'d.
  • Switch from a default export to named exports.
    - import Youch from 'youch'
    + import { Youch } from 'youch'
  • The Youch constructor no longer accepts the error or request object. Instead, the error is passed directly to toHTML(), toJSON(), and the new toANSI() methods.
    - const youch = new Youch(error, req)
    - const html = await youch.toHTML()
    - const json = await youch.toJSON()
    + const youch = new Youch()
    + const html = await youch.toHTML(error)
    + const json = await youch.toJSON(error)
  • The HTTP request is no longer passed to the constructor. Pass it as an option to toHTML() instead. The request must be a plain object with url, method, and headers properties (not a Node.js http.IncomingMessage).
    - const youch = new Youch(error, req)
    - const html = await youch.toHTML()
    + const youch = new Youch()
    + const html = await youch.toHTML(error, {
    +   request: {
    +     url: req.url,
    +     method: req.method,
    +     headers: req.headers,
    +   },
    + })
  • The toJSON() return value is now a ParsedError object directly, instead of being wrapped inside { error: {...} }.
    - const { error } = await youch.toJSON()
    - console.log(error.message)
    + const error = await youch.toJSON(error)
    + console.log(error.message)
  • The toHTML() method no longer accepts arbitrary template data. Use the structured options object instead, which accepts title, cspNonce, ide, request, offset, and frameSourceBuffer.
    - await youch.toHTML({ cspNonce: 'abc123' })
    + await youch.toHTML(error, { cspNonce: 'abc123' })
  • The preLines and postLines constructor options have been replaced by frameSourceBuffer on each render method.
    - const youch = new Youch(error, req, { preLines: 8, postLines: 8 })
    - const html = await youch.toHTML()
    + const youch = new Youch()
    + const html = await youch.toHTML(error, { frameSourceBuffer: 8 })
  • Remove the addLink() method. Custom links can no longer be added to the error page. Use the new template/component system to customize the HTML output instead.
  • Remove the toggleShowAllFrames() method. Frame visibility is now handled by the new HTML UI.

Features

  • Add toANSI() method for rendering errors as ANSI-colored terminal output.
    const youch = new Youch()
    const output = await youch.toANSI(error)
    console.log(output)
  • Add structured Metadata API for attaching contextual information to error pages. Metadata is organized into groups, sections, and rows.
    const youch = new Youch()
    youch.metadata.group('Request', {
      Headers: [
        { key: 'Host', value: 'localhost:3000' },
        { key: 'Accept', value: 'text/html' },
      ],
      Cookies: [
        { key: 'session_id', value: 'abc123' },
      ],
    })
  • Add useParser() for pre-processing errors before they are parsed.
    youch.useParser((source) => {
      // Normalize or transform the error before parsing
      return source
    })
  • Add useTransformer() for post-processing parsed errors.
    youch.useTransformer((error, source) => {
      // Mutate the ParsedError after parsing
      error.hint = 'Did you forget to install dependencies?'
    })
  • Add defineSourceLoader() for custom source code loading (e.g., remote files, bundled sources).
    youch.defineSourceLoader(async (frame) => {
      const contents = await fetchSource(frame.fileName)
      return { contents }
    })
  • Add pluggable template/component system. Every section of the HTML output (header, layout, errorInfo, errorStack, errorStackSource, errorCause, errorMetadata) can be replaced with a custom component.
    youch.templates.use('errorInfo', new MyCustomErrorInfo())
  • Add IDE integration. Clicking file paths in the HTML output opens them in your editor. Configurable via the ide option ("vscode", "sublime", "phpstorm", etc.) or a custom URL format.
    await youch.toHTML(error, { ide: 'vscode' })
  • Add templates.injectStyles() for injecting custom CSS into the error page.
    youch.templates.injectStyles(':root { --surface-bg: #1a1a2e; }')
  • Add dark mode support with automatic theme toggle in the HTML output.
  • Export BaseComponent class for building custom template components.
  • Export Metadata class for standalone use.

What's Changed

New Contributors

**Full Changel...

Read more

Escape HTML in error context and copy error with complete stack trace

12 Feb 10:52

Choose a tag to compare

4.1.0-beta.14 (2026-02-12)

Bug Fixes

Features

What's Changed

  • fix: Escape HTML in error content by @AylenHoz in #83
  • feat: add stack trace to copy button by @atinux in #86

New Contributors

Full Changelog: v4.1.0-beta.13...v4.1.0-beta.14

Release 4.1.0-beta.13

18 Nov 04:27

Choose a tag to compare

Release 4.1.0-beta.13 Pre-release
Pre-release

4.1.0-beta.13 (2025-11-18)

Bug Fixes

  • Adjust styles for devices with small screens (#82) 121a017, closes #82

Bug fixes and replace cookie package with cookie-es

03 Nov 05:32

Choose a tag to compare

4.1.0-beta.12 (2025-11-03)

Bug Fixes

  • template: wrong scollbar color when page and browser theme mismatch (#80) (d2951f3)

Features

  • add no trace example (8df333e)
  • replace cookie package with cookie-es (60b49e4), closes #79

What's Changed

  • fix - Support errors without stack trace and move scripts to the body end by @AylenHoz in #77
  • fix(template): wrong scollbar color when page and browser theme mismatch by @L33Z22L11 in #80

New Contributors

Full Changelog: v4.1.0-beta.11...v4.1.0-beta.12

Add copy button to copy the error message

30 Jul 04:33

Choose a tag to compare

4.1.0-beta.11 (2025-07-30)

Bug Fixes

  • rename jsFile property to scriptFile (94358df)

Features

  • add copy button for copying error name + message (#76) (bfe0366)
  • add logos (781e496)
  • copy button styling improvements (d3b5cf4)
  • mute copy button icon default color (a974f0f)

What's Changed

  • feat: add copy button for copying error name + message by @danielroe in #76

New Contributors

Full Changelog: v4.1.0-beta.10...v4.1.0-beta.11

Update dependencies

04 Jul 10:44

Choose a tag to compare

Update dependencies Pre-release
Pre-release

4.1.0-beta.10 (2025-07-04)

Full Changelog: v4.1.0-beta.9...v4.1.0-beta.10

Fix CSP issue

27 Jun 08:52

Choose a tag to compare

Fix CSP issue Pre-release
Pre-release

4.1.0-beta.9 (2025-06-27)

Bug Fixes

Full Changelog: v4.1.0-beta.8...v4.1.0-beta.9

Add missing `@poppinss/colors` dependency

28 May 04:13

Choose a tag to compare

4.1.0-beta.8 (2025-05-28)

What's Changed

  • Add @poppinss/colors dependency to satisfy Yarn PnP requirements by @robigan in #71

New Contributors

Full Changelog: v4.1.0-beta.7...v4.1.0-beta.8

Mobile view styling fixes

09 Apr 04:36

Choose a tag to compare

Pre-release

4.1.0-beta.7 (2025-04-09)

Bug Fixes

  • Add or execute DOMContentLoaded events based on document state (#65) (e136cb8)
  • Adjust HTML styles for small screens (#67) (468e628)

What's Changed

  • Adjust HTML styles for small screens by @AylenHoz in #67
  • fix: Add or execute DOMContentLoaded events based on document state by @AylenHoz in #65

Full Changelog: v4.1.0-beta.6...v4.1.0-beta.7