Keyboard

Shortcuts

Command palette
K
Home
gh
About
ga
Projects
gp
Expertise
gx
Journal
gj
Contact
gc
Copy email
e
Call
c
Toggle theme
t
Show this help
?

↑↓ to navigate · Enter to open · Esc to close

Field notes

REX: AbortError on theme toggle (View Transitions)

TL;DR Double-click / fast navigation aborts the View Transition. Catch `AbortError`, do not report it.

22 May 2026 · Albert Nicolas

  • javascript
  • ux
  • sentry
  • rex
REX: AbortError on theme toggle (View Transitions)

1 min read Reading 0%

On the portfolio, the light/dark toggle uses View Transitions when the browser exposes them. An impatient user double-clicks → the transition aborts → AbortError.

I had let it surface as a real exception. Sentry loved that. I did not.

Mental fix

try {
  await document.startViewTransition(() => applyTheme(next)).finished;
} catch (err) {
  if (err?.name === 'AbortError') return;
  throw err;
}

Lesson

A useful REX documents the symptom, the cause, and the guardrail. Not a novel. This one cost me an hour — and saved me from “just disable View Transitions” panic.

← Back to journal

Contact me Call