cloudflare / cloudflare/vinext
App Router metadata icons: favicon/icon links not emitted and reinjection script missing
- Dominant language
- TypeScript
- Stars
- 8.8k
- Forks
- 406
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 120
Description
> *This issue was created by an agent analysing CI failures from the [Next.js Deploy Suite](https://github.com/cloudflare/vinext/actions/runs/26282973805) (vinext `main` vs Next.js `v16.2.6`, 2026-05-22).*
## Problem
App Router metadata icon support is incomplete. Automatic favicon detection emits zero `` elements when one is expected; custom icons declared via metadata (`shortcut-icon.png`) do not appear in the document head; the runtime script that moves body-injected icon links back into the head during streaming is missing.
```
Expected: 1 (favicon link count) | Received: 0
```
```
Expected: "/shortcut-icon.png" | Received: undefined
```
## Estimated Impact
~6 test failures across the deploy suite.
## Affected Test Suites
- `test/e2e/app-dir/metadata-icons/metadata-icons.test.ts` (6 failures)
## Recommendation
1. **Reproduce first in vinext's own test suite.** Add a fixture with `app/icon.png` and `app/shortcut-icon.png` and assert both render as `` / `` in the head.
2. **Implement automatic icon detection.** Scan the `app/` directory for the documented icon filenames and emit the corresponding head tags.
3. **Implement metadata-driven icons.** Honor `metadata.icons` in `layout.tsx` / `page.tsx`.
4. **Add the body->head reinjection script.** During streaming, icon links may flush into the body; emit the small reinjection script Next.js ships so the browser moves them to the head.
Contributor guide
Assessment
This issue has not been assessed yet.