Skip to content

/jobs/<slug> and /users/<slug> throw React #418 (hydration failed, tree regenerated) on every anonymous load of a production build #786

Closed

Description

@thinkclay

Found by the hydration probe written for #782, and confirmed on main's production build before that change, so it is independent of it.

What

On a production export (expo export --platform web, served by expo serve), an anonymous load of either public detail page throws, once per load, at every width tried (390 with an iPhone UA, 800 with an iPad UA, 1440):

Minified React error #418; visit https://react.dev/errors/418?args[]=HTML

#418 is "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client." — the severe variant, the one that discards the server tree.

page main @ d2b275c76 (prod build) #782 branch (prod build)
/jobs clean clean
/ clean clean
/terms clean clean
/jobs/senior-software-engineer-unicorn #418 every load #418 every load
/users/eric #418 every load #418 every load

It is not the viewport snapshot (#782 fixed that and this is unchanged), not a session (anonymous), and not the hydration race in #681 (deterministic — three of three loads, every device). The dev server at 1440 did not show it on the #762 branch, which suggests it is in something that differs between dev and the production export: minification, __DEV__-only code paths, or what <Head> / the JSON-LD components emit.

Where to look

Both pages share DashboardLayout with a breadcrumb (packages/scf-core/components/layouts/DashboardLayout.tsx), a JsonLd component (JobPostingJsonLd / ProfileJsonLd), an SEO head component, and content derived from the loader's row. /jobs shares DashboardLayout and is clean, which points at the per-item pieces: the JSON-LD <script> content, getCanonicalUrl, relative-time strings (formatRelativeDate), or a Text node whose server and client text differ.

React's own console message (in a dev build, or a non-minified production build) prints the +/- diff. The quickest path is expo export with minification off, or a dev-server run with NODE_ENV=production semantics, and reading that diff.

Acceptance

Related: #782 (where the probe came from), #681 (the intermittent variant, a different mechanism), #679, #774 (these are the pages a search result lands on).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Frontendbugpriority: high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions