diff --git a/packages/next/client/components/react-dev-overlay/internal/container/RootLayoutError.tsx b/packages/next/client/components/react-dev-overlay/internal/container/RootLayoutError.tsx index e12a947c08d0..ae61be5d20b3 100644 --- a/packages/next/client/components/react-dev-overlay/internal/container/RootLayoutError.tsx +++ b/packages/next/client/components/react-dev-overlay/internal/container/RootLayoutError.tsx @@ -14,7 +14,7 @@ export type RootLayoutErrorProps = { missingTags: string[] } export const RootLayoutError: React.FC = function BuildError({ missingTags }) { const message = - 'Please make sure to include the following tags in your root layout: , , .\n\n' + + 'Please make sure to include the following tags in your root layout: , .\n\n' + `Missing required root layout tag${ missingTags.length === 1 ? '' : 's' }: ` + diff --git a/packages/next/server/node-web-streams-helper.ts b/packages/next/server/node-web-streams-helper.ts index 9d5bfbe8f982..3cb0cc6afb0c 100644 --- a/packages/next/server/node-web-streams-helper.ts +++ b/packages/next/server/node-web-streams-helper.ts @@ -263,19 +263,15 @@ export function createRootLayoutValidatorStream( getTree: () => FlightRouterState ): TransformStream { let foundHtml = false - let foundHead = false let foundBody = false return new TransformStream({ async transform(chunk, controller) { - if (!foundHtml || !foundHead || !foundBody) { + if (!foundHtml || !foundBody) { const content = decodeText(chunk) if (!foundHtml && content.includes(' { expect(await hasRedbox(browser, true)).toBe(true) expect(await getRedboxSource(browser)).toMatchInlineSnapshot(` - "Please make sure to include the following tags in your root layout: , , . + "Please make sure to include the following tags in your root layout: , . - Missing required root layout tags: html, head, body" + Missing required root layout tags: html, body" `) }) @@ -57,9 +57,9 @@ describe('app-dir root layout', () => { expect(await hasRedbox(browser, true)).toBe(true) expect(await getRedboxSource(browser)).toMatchInlineSnapshot(` - "Please make sure to include the following tags in your root layout: , , . + "Please make sure to include the following tags in your root layout: , . - Missing required root layout tags: html, head, body" + Missing required root layout tags: html, body" `) }) @@ -70,9 +70,9 @@ describe('app-dir root layout', () => { expect(await hasRedbox(browser, true)).toBe(true) expect(await getRedboxSource(browser)).toMatchInlineSnapshot(` - "Please make sure to include the following tags in your root layout: , , . + "Please make sure to include the following tags in your root layout: , . - Missing required root layout tags: html, head, body" + Missing required root layout tags: html, body" `) }) }) diff --git a/test/e2e/app-dir/root-layout/app/(required-tags)/has-tags/layout.js b/test/e2e/app-dir/root-layout/app/(required-tags)/has-tags/layout.js index f8fd9c6d9b3e..7519206f5c7b 100644 --- a/test/e2e/app-dir/root-layout/app/(required-tags)/has-tags/layout.js +++ b/test/e2e/app-dir/root-layout/app/(required-tags)/has-tags/layout.js @@ -4,9 +4,6 @@ export const revalidate = 0 export default function Root({ children }) { return ( - - Hello World - {children} )