Repository navigation
Conversation
Under next dev the article streams into a hidden holder outside <article> and is swapped in later. When the workspace shell mounts first, the article is rendered again on the client, so for a moment the page has two h1 elements and a bare h1 locator fails Playwright's strict mode.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Why
Website — e2e (control-plane)failed on #1609 (run 43773295008, attempt 1) inreact-docs-parity.spec.ts:49with a strict-mode violation:locator('h1')resolved to two<h1 id="choosing-an-adapter">, one hidden. It passed on rerun. The PR's diff did not touch the website.Cause
A race that exists only under
next dev, which is what this suite runs against:MdxRendererwraps the article in<Suspense>in development only (the workaround for the React hydration replay bug). The article therefore streams after the shell into a hidden<div hidden id="S:0">holder, which sits outside<article>.$RCscript queues that holder and swaps it in later, on the next animation frame or on a timer of up to about 300 ms.[data-workspace-shell]mounts during hydration. If it mounts before the swap, React renders the article on the client at its new position.h1and the hidden one.A probe with a
MutationObserversaw the overlap in 8 of 18 loads of/docs/choosing-an-adapteron a local dev server, lasting about 20 ms each time. Production does not render the boundary and is not affected.Change
Line 49 uses
page.locator('article h1'), the locator the same file already uses at line 34. In the served HTML theS:0holder is outside<article>and the boundary is inside it, so the scoped locator can match only the revealed or client-rendered heading.Verification
<article>, closed before theS:0holder; the only streamedh1is inside the holder.next devwithBASE_URLset: with the change, 12 passed and none failed at line 49; without it, 13 passed and 2 failed at line 49 with the strict-mode violation. The other failures in both runs were timeouts earlier in the test, inside theselectFrameworkfixture, on my machine.website:e2e-control-planetarget with its own servers.Not changed:
library-pages.spec.ts:12andeditorial-pages.spec.ts:13also use a barepage.locator('h1'); whether those routes go through the same boundary was not checked.🤖 Generated with Claude Code