Files
cloudflare__vinext/tests
Lubomir Georgiev (Любомир Георгиев) bbec971d8f fix(app-router): preserve streamed metadata placement parity (#2572)
* fix(app-router): hoist streamed metadata into <head> instead of body

Async generateMetadata was serialized via dangerouslySetInnerHTML into a
hidden <div> in the body, which React cannot hoist. For JS-capable clients
(browsers, Googlebot) the tags stayed in <body>, where Google ignores
rel=canonical, hreflang and robots.

Render the resolved metadata as real <title>/<meta>/<link> elements through
MetadataHead so React 19 hoists them into <head>, matching Next.js. Remove
the now-unused renderMetadataToHtml string serializer.

* Fix tests

* fix(app-router): harden metadata hoisting coverage

* fix(app-router): restore streamed metadata placement

* fix(app-router): preserve static metadata placement

---------

Co-authored-by: James <james@eli.cx>
2026-07-10 09:17:32 +01:00
..