cloudflare / cloudflare/vinext
`<head>` charset <meta> is not emitted as the first head element (App Router)
- Dominant language
- TypeScript
- Stars
- 8.8k
- Forks
- 406
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 120
Description
_Found running the official Next.js e2e test suite against vinext (vinext 1.0.0-beta.8, Next.js 16.2). Error line is from the suite's own output._
**Fixture:** `test/e2e/next-head`
**Symptom:** the `` element is not the first child of ``. Next.js guarantees the charset meta is emitted first — the HTML spec requires the encoding declaration to appear within the first 1024 bytes, and a late charset can trigger a browser encoding re-parse.
**Repro:** build an App Router page with custom head tags; assert `document.head.firstElementChild` is the charset meta. Expected: charset first. Actual: emitted after other head elements.
Contributor guide
Research direction
Start with the test/e2e/next-head fixture and run the official Next.js end-to-end reproduction for an App Router page with custom head tags. Trace the head output until the charset meta ordering is determined; done means document.head.firstElementChild is the charset meta, before all other head elements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100