Skip to content

[finding] The 404 document's title reverts to "ObjectOS" once React hydrates, losing the "404:" prefix #212

Description

@hotlong

(Angle-bracket markup omitted throughout — this repo's sanitizer strips it, including inside code fences. "title element" means the HTML element of that name.)

Observation-class, found while measuring #191. Pre-existing on main — measured on ffe36c5, before any change, and reproduced identically on a modified tree, so it is not introduced by #191's work.

What happens

apps/docs/app/not-found.tsx renders a title element reading 404: This page could not be found.. That is what the browser shows while the document is parsing. Once React hydrates, Next's metadata system applies the root layout's default title from app/layout.tsx (title.default: 'ObjectOS') and the document title becomes plain ObjectOS.

Measured in a real Chromium against next start on a production build of ffe36c5:

tree title at load title after hydration
main at ffe36c5 404: This page could not be found. ObjectOS

The same reading on the #191 branch is identical in both columns except for the locale swap, which is how it was established as pre-existing rather than introduced.

Why it is worth recording

The title element is what lands in the browser tab, in history, and in a bookmark. A reader who bookmarks or back-buttons through a dead link gets an entry that reads ObjectOS, indistinguishable from the real site index. It is the same class of "the status is right and the presentation is not" that #182 and #209 dealt with, just much smaller — the status code is correct, the body is correct, only the title is overwritten.

It is genuinely cosmetic: a 404 body carries meta name="robots" content="noindex" (confirmed present in the served markup on this tree), so nothing about this reaches an index.

Not fixed here

Out of scope for #191, whose granted surface is the lang attribute and the 404 copy. Filed unassigned rather than fixed because the mechanism sits in Next's metadata handling rather than in the not-found component, and choosing between "give the not-found route its own metadata export" and "leave it" is a call worth making deliberately rather than as a rider.

Possibly related but distinct: #171 covers brand/title spelling on the index page (ObjectOS | ObjectOS); this is the 404 route specifically and a different mechanism. #171 remains open and is not addressed here.


Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions