test(app-router): remove nested document tags from interception fixtures - #2790
Open
MaxtuneLee wants to merge 2 commits into
Open
test(app-router): remove nested document tags from interception fixtures#2790MaxtuneLee wants to merge 2 commits into
MaxtuneLee wants to merge 2 commits into
Conversation
commit: |
MaxtuneLee
marked this pull request as ready for review
August 2, 2026 07:15
Contributor
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 nestedinterception-dyn-seglayout rendered<html>withoutlang. React reported this as an attribute-only hydration mismatch: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.tsxinterception-dyn-single/layout.tsxinterception-segments-two-levels-above/layout.tsxinterception-routes-multiple-catchall/layout.tsxinterception-from-root/[locale]/layout.tsxThe layouts continue to render the same route content and slot containers beneath the shared root layout.
Test plan
vp fmt --checkon all five modified layout files.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.