mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
The `key` prop on `<Head>` component differs during prerender and a PPR resume because of search params being part of the key, causing the resume to treat them as distinct components, hence the error\*. However, it is necessary semantically to include search params in the key for `<Head>`, so we will remove the search params from the key during the resume SSR. \*Mismatch Error: ``` тип [Error: Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering.] ```
27 lines
999 B
TypeScript
27 lines
999 B
TypeScript
import { nextTestSetup } from 'e2e-utils'
|
|
|
|
describe('resuming-head-runtime-search-param', () => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should not show resumable slots error when using runtime search params', async () => {
|
|
const browser = await next.browser('/?foo=bar&test=123')
|
|
|
|
// Check that the page renders correctly
|
|
await browser.waitForElementByCss('p')
|
|
const text = await browser.elementByCss('p').text()
|
|
expect(text).toContain('hello world')
|
|
|
|
// Wait for dynamic content to load (it's rendered inside the first p element)
|
|
await browser.waitForElementByCss('p p')
|
|
const dynamicText = await browser.elementByCss('p p').text()
|
|
expect(dynamicText).toContain('Dynamic Hole')
|
|
|
|
// Check server logs for the specific error message
|
|
expect(next.cliOutput).not.toContain(
|
|
"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
|
|
)
|
|
})
|
|
})
|