diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index 255a8f4766f60..d192970eec658 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -319,7 +319,11 @@ async function generateFlight( flightRouterState, isFirst: true, // For flight, render metadata inside leaf page - rscPayloadHead: , + // NOTE: in 14.2, fragment doesn't work well with React, using array instead + rscPayloadHead: [ + , + , + ], injectedCSS: new Set(), injectedJS: new Set(), injectedFontPreloadTags: new Set(), @@ -526,11 +530,11 @@ async function ReactServerError({ const head = ( <> {/* Adding requestId as react key to make metadata remount for each render */} - {process.env.NODE_ENV === 'development' && ( )} + ) diff --git a/test/e2e/app-dir/metadata-navigation/metadata-navigation.test.ts b/test/e2e/app-dir/metadata-navigation/metadata-navigation.test.ts index 840104992058e..10accfbc6d7c4 100644 --- a/test/e2e/app-dir/metadata-navigation/metadata-navigation.test.ts +++ b/test/e2e/app-dir/metadata-navigation/metadata-navigation.test.ts @@ -8,7 +8,7 @@ createNextDescribe( ({ next }) => { it('should show the index title', async () => { const browser = await next.browser('/') - expect(browser.elementByCss('title').text()).toBe('Home Layout') + expect(await browser.elementByCss('title').text()).toBe('Home Layout') }) it('should show target page metadata after navigation', async () => { @@ -22,7 +22,7 @@ createNextDescribe( const browser = await next.browser('/') await browser.elementByCss('#product-link').click() await browser.waitForElementByCss('#product-title') - await browser.elementByCss('#back-link').click() + await browser.elementByCss('#home-link').click() await browser.waitForElementByCss('#home-title') expect(await browser.elementByCss('title').text()).toBe('Home Layout') }) diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index fe6892510978d..956dfbd55ca77 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -2118,7 +2118,8 @@ "app dir - not-found - basic with default runtime should use the not-found page for non-matching routes", "app dir - not-found - basic with runtime = edge should escalate notFound to parent layout if no not-found boundary present in current layer", "app dir - not-found - basic with runtime = edge should match dynamic route not-found boundary correctly", - "app dir - not-found - basic with runtime = edge should use the not-found page for non-matching routes" + "app dir - not-found - basic with runtime = edge should use the not-found page for non-matching routes", + "app dir - not-found - basic should return 404 status code for custom not-found page" ], "failed": [ "app dir - not-found - basic should include not found client reference manifest in the file trace"