Skip to content

test(app-router): remove nested document tags from interception fixtures - #2790

Open
MaxtuneLee wants to merge 2 commits into
cloudflare:mainfrom
MaxtuneLee:main
Open

test(app-router): remove nested document tags from interception fixtures#2790
MaxtuneLee wants to merge 2 commits into
cloudflare:mainfrom
MaxtuneLee:main

Conversation

@MaxtuneLee

Copy link
Copy Markdown
Contributor

Summary

Related to #2706.

While investigating the failing tests in #2706, I found that they were already triggering hydration errors. After the hydration error overlay was fixed in #2706, the overlay began appearing during the E2E tests and interrupted the test scripts, causing them to fail.

More detailed findings are listed below.

Why

These layouts were ported from standalone Next.js E2E applications. In the original Next.js fixtures, each file is the application root layout, so returning <html> and <body> is correct.

vinext combines these suites under tests/fixtures/app-basic/app. The shared fixture already has a root layout that returns <html lang="en"> and <body>, which makes each ported interception layout a nested layout. Nested layouts must not return another document root.

Keeping the original document tags caused React to hydrate different document attributes. For example, the server document retained lang="en" from the shared root layout while the nested interception-dyn-seg layout rendered <html> without lang. React reported this as an attribute-only hydration mismatch:

<html
-  lang="en"
>

The interception tests previously passed because this mismatch was only written to the browser console. Once the development error overlay correctly surfaced attribute-only hydration warnings, the overlay covered the page and intercepted Playwright clicks. That exposed an existing fixture problem rather than an interception-routing regression.

Fixing the fixtures separately keeps the development overlay behavior intact and makes the ported tests accurately represent their location inside the shared application.

Changes

Remove nested document elements from:

  • interception-dyn-seg/layout.tsx
  • interception-dyn-single/layout.tsx
  • interception-segments-two-levels-above/layout.tsx
  • interception-routes-multiple-catchall/layout.tsx
  • interception-from-root/[locale]/layout.tsx

The layouts continue to render the same route content and slot containers beneath the shared root layout.

Test plan

  • vp fmt --check on all five modified layout files.
  • Run the five affected Playwright specs: 29 passed.
  • Open each affected entry route in Chromium and monitor console.error: 0 attribute-only hydration mismatches.

No new regression test is included in this PR, and the existing E2E suites continue to verify interception behavior.

@pkg-pr-new

pkg-pr-new Bot commented Aug 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@2790
npm i https://pkg.pr.new/create-vinext-app@2790
npm i https://pkg.pr.new/@vinext/types@2790
npm i https://pkg.pr.new/vinext@2790

commit: 9fd6691

@MaxtuneLee
MaxtuneLee marked this pull request as ready for review August 2, 2026 07:15
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 9fd6691 against base 3c5cea4 using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 0 regressed · 6 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 134.6 KB 134.6 KB ⚫ 0.0%
Client entry size (gzip) vinext 122.2 KB 122.2 KB ⚫ -0.0%
Dev server cold start vinext 2.97 s 2.98 s ⚫ +0.3%
Production build time vinext 3.16 s 3.16 s ⚫ -0.1%
RSC entry closure size (gzip) vinext 113.9 KB 113.9 KB ⚫ +0.0%
Server bundle size (gzip) vinext 191.4 KB 191.4 KB ⚫ -0.0%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant