Islands used in `_app.tsx`, `_layout.tsx`, or `_error.tsx` are discovered after `<head>` has already rendered, so their CSS `<link>` tags were never injected. `FreshScripts` (at end of `<body>`) now emits late CSS for any islands missed by `RemainingHead`, using an `injectedCss` set to avoid duplicates. In dev mode, `collectCss` only walked the `fresh:client-entry` module graph, missing CSS imported by island modules. The dev server now also walks `fresh-island::*` module graphs when collecting CSS. Note: late-injected `<link>` tags in `<body>` may cause a brief flash of unstyled content — this is inherent to the problem since `<head>` renders before `<body>` islands are discovered. Closes #3633 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
450 B
TypeScript
19 lines
450 B
TypeScript
import type { PageProps } from "fresh";
|
|
import { AppNav } from "../islands/AppNav.tsx";
|
|
|
|
export default function App({ Component }: PageProps) {
|
|
return (
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta name="custom" content="foo" />
|
|
</head>
|
|
<body>
|
|
<AppNav />
|
|
<Component />
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|