Skip to content

feat: @ottabase/error-page — edge-compatible error rendering with dev/prod modes - #119

Draft
thinkdj with Copilot wants to merge 4 commits into
mainfrom
copilot/replicate-youch-error-handling
Draft

feat: @ottabase/error-page — edge-compatible error rendering with dev/prod modes#119
thinkdj with Copilot wants to merge 4 commits into
mainfrom
copilot/replicate-youch-error-handling

Conversation

Copilot AI commented Feb 25, 2026

Copy link
Copy Markdown

Replaces the youch naming with a generic @ottabase/error-page package. Adds production-safe error pages and integrates as the default worker error handler.

Package: @ottabase/error-page

  • Edge-runtime compatible stack trace parser (V8/SpiderMonkey/JSC)
  • Self-contained HTML renderer with dark/light mode, XSS escaping, CSP nonce support
  • ErrorPage.toHTML() — detailed dev error page (stack trace, request metadata, error cause chain, "open in editor" links)
  • ErrorPage.toProductionHTML() — minimal production page (status code + generic message, no internals)
  • 53 tests across parser, renderer, and integration

Worker integration

Request Dev Production
HTML Full stack trace + metadata Clean status page
API JSON with error message JSON with generic message
const errorPage = new ErrorPage();

// Dev: rich error page
errorPage.addRequestMetadata(request);
const html = errorPage.toHTML(err, { title: 'Worker Error' });

// Prod: safe error page
const html = errorPage.toProductionHTML(500);

Production error page

Production Error Page

Cleanup

Zero youch references in source code. Remaining occurrences in pnpm-lock.yaml are transitive deps from wrangler/miniflare.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…s (inspired by poppinss/youch)

Co-authored-by: thinkdj <688055+thinkdj@users.noreply.github.com>
Copilot AI changed the title [WIP] Replicate youch error handling for monorepo and tanstack app Add @ottabase/youch — edge-compatible pretty error pages Feb 25, 2026
Copilot AI requested a review from thinkdj February 25, 2026 07:44
…rences, add enhancements

Co-authored-by: thinkdj <688055+thinkdj@users.noreply.github.com>
Copilot AI changed the title Add @ottabase/youch — edge-compatible pretty error pages Add @ottabase/error-page — edge-compatible pretty error renderer Feb 25, 2026
- Add renderProductionHTML() for clean production error pages
- Add toProductionHTML() method to ErrorPage class
- Update cloudflare-worker.ts: dev=detailed HTML, prod=minimal HTML, API=JSON
- Add 12 new tests for production error page (53 total)
- Update README with production mode docs and integration example

Co-authored-by: thinkdj <688055+thinkdj@users.noreply.github.com>
Copilot AI changed the title Add @ottabase/error-page — edge-compatible pretty error renderer feat: @ottabase/error-page — edge-compatible error rendering with dev/prod modes Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants