·StoryRoll

The Page Translator Ate Our Play Screen

Founder log, November 5, 2026. Raw, pre-launch, written from the git record.

For six months we had an error we had marked as ignored. 307 events since May. NotFoundError: Failed to execute 'removeChild'. Mostly on the play page, and every single event came from Chrome.

Ignoring it was a decision, and it was the wrong one. The error is the "Something went wrong" screen. It appears in the middle of a story, while the Game Master is narrating, and it takes the session with it.

The pattern nobody wanted to see

Two more Sentry issues turned out to be the same crash wearing different clothes. One was insertBefore on the play page. The other was in the spell-slot tracker.

None of it reproduced for us. We browse in English. Then we traced the real cases:

  • The newest event, from November 1: a browser set to Spanish (Latin America).
  • The first gm_error_shown error page we ever logged: Spanish (Spain).
  • A recorded first session that ended on the error page, with the error page shown in French.

Every case we could trace was a non-English browser. Chrome offers to translate the page, the player says yes, and the story ends.

What the translator does

Chrome's translation does not change text in place. It swaps each text node for its own <font> wrapper. React has no idea. When React later wants to remove or move one of the original nodes, the node is no longer where React left it, and the DOM throws.

A narrated scene is the worst case for this. Text streams in constantly, so React is removing and moving nodes all the time. A static page might survive a translate click. A page where the GM is mid-sentence will not.

The fix, and what it costs

The patch is the old workaround from the React issue tracker (facebook/react#11538). Before removeChild or insertBefore runs, check whether the node is really where React thinks it is. If it is not, skip the call.

It lives in one small file, src/lib/translation-dom-guard.ts, called once from the client Sentry config, which loads ahead of the app. Three unit tests cover it: skip a node the translator moved, still remove a real child, and skip a moved reference while leaving plain appends alone.

The costs are real, and I chose them on purpose:

  • On a translated page, a bit of text can stay stale until the next render. That beats losing the session.
  • The guard is global. If our own code ever misplaces a node, that bug would no longer throw. It would just do nothing.

Today every error in that family comes from translation. Today.

What I could not check

The full production build did not finish in the sandbox where the change was written, because it could not reach the font host. Typecheck passed, 2,978 unit tests passed, lint was clean. But there is no automated check that proves a translated play page survives a turn. That needs a person with Chrome, Translate switched on, and a story in progress.

So the success test is simple, and it is not a green checkmark. Those three Sentry issues should stop receiving events, and the error-page count should fall to near zero.

I will be watching that count, and I am not sure what I want to see. A quiet dashboard means the patch worked. It also means the next real bug will look exactly the same.

Now every one of those errors fails silently, so the next real bug will not announce itself.

S

Written by StoryRoll

Founder of StoryRoll. Building AI-powered tabletop RPGs.

Share:Share on X

Related Posts