next/script rendered the theme script with a nonce, and browsers hide a nonce attribute from the DOM once they have parsed it, so the server sent nonce="" and the client read undefined. Every page load logged a hydration mismatch. The cookie is the fix rather than a workaround for it. The server reads it and stamps data-theme on the html element, so the first frame is already the right colour and there is no inline script at all. Chasing that turned up worse. /offline sat outside [locale], which made it a sibling of the root layout, so Next gave it a generated one: no stylesheet, no font, no theme, and a second html element. The phase 7 check asserted the text and a button and passed while the page was plainly broken. It is a normal screen now. The service worker keeps one offline copy per language the reader actually visits, learned from their own successful navigations, so no list of locales lives in the worker and a third language stays a catalog file. The e2e warm-up also asks for the dynamic routes, which cost a compile of their own and were being paid for by whichever test reached one first. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
13 lines
332 B
TypeScript
13 lines
332 B
TypeScript
'use client';
|
|
|
|
import { Button } from '@/components/ui/button';
|
|
|
|
/** Reloads whatever the reader was trying to reach, which is the only action here. */
|
|
export function RetryButton({ label }: { label: string }) {
|
|
return (
|
|
<Button type="button" block onClick={() => window.location.reload()}>
|
|
{label}
|
|
</Button>
|
|
);
|
|
}
|