cloudflare / cloudflare/vinext

`<head>` charset <meta> is not emitted as the first head element (App Router)

Open
#3,216 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.