File tree Expand file tree Collapse file tree 4 files changed +26
-9
lines changed Expand file tree Collapse file tree 4 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -50,11 +50,14 @@ export const copyPrerenderedContent = async (ctx: PluginContext): Promise<void>
5050 const manifest = await ctx . getPrerenderManifest ( )
5151
5252 await Promise . all (
53- Object . entries ( manifest . routes ) . map ( async ( [ route , meta ] ) => {
53+ Object . entries ( manifest . routes ) . map ( async ( [ route , meta ] ) : Promise < void > => {
5454 const key = routeToFilePath ( route )
5555 let value : CacheValue
56-
5756 switch ( true ) {
57+ // Parallel route default layout has no prerendered page
58+ case meta . dataRoute ?. endsWith ( '/default.rsc' ) &&
59+ ! existsSync ( join ( ctx . publishDir , 'server/app' , `${ key } .html` ) ) :
60+ return
5861 case meta . dataRoute ?. endsWith ( '.json' ) :
5962 value = await buildPagesCacheValue ( join ( ctx . publishDir , 'server/pages' , key ) )
6063 break
Original file line number Diff line number Diff line change @@ -107,7 +107,10 @@ export const writeTagsManifest = async (ctx: PluginContext): Promise<void> => {
107107 const meta = JSON . parse ( file )
108108 tags = meta . headers [ 'x-next-cache-tags' ]
109109 } catch {
110- console . log ( `Unable to read cache tags for: ${ path } ` )
110+ // Parallel route default layout has no prerendered page, so don't warn about it
111+ if ( ! definition . dataRoute ?. endsWith ( '/default.rsc' ) ) {
112+ console . log ( `Unable to read cache tags for: ${ path } ` )
113+ }
111114 }
112115 }
113116
Original file line number Diff line number Diff line change @@ -61,10 +61,14 @@ export default async (request: Request) => {
6161 setVaryHeaders ( response . headers , request , nextConfig )
6262
6363 // Temporary workaround for an issue where sending a response with an empty
64- // body causes an unhandled error.
64+ // body causes an unhandled error. This doesn't catch everything, but redirects are the
65+ // most common case of sending empty bodies. We can't check it directly because these are streams.
66+ // The side effect is that responses which do contain data will not be streamed to the client,
67+ // but that's fine for redirects.
6568 // TODO: Remove once a fix has been rolled out.
6669 if ( response . status > 300 && response . status < 400 ) {
67- return new Response ( null , response )
70+ const body = await response . text ( )
71+ return new Response ( body || null , response )
6872 }
6973
7074 return response
Original file line number Diff line number Diff line change 2121 ]
2222 },
2323 "test/e2e/app-dir/parallel-routes-and-interception/parallel-routes-and-interception.test.ts" : {
24- "failed" : [
25- " parallel-routes-and-interception route intercepting should render modal when paired with parallel routes " ,
26- " parallel-routes-and-interception route intercepting should support intercepting local dynamic sibling routes "
24+ "failed" : [],
25+ "flakey" : [
26+ " parallel-routes-and-interception parallel routes should gracefully handle when two page segments match the `children` parallel slot "
2727 ]
2828 },
2929 "test/e2e/app-dir/error-boundary-navigation/override-node-env.test.ts" : {
107107 "test/e2e/app-dir/metadata/metadata.test.ts" : {
108108 "flakey" : [
109109 " app dir - metadata opengraph should pick up opengraph-image and twitter-image as static metadata files" ,
110- " app dir - metadata static routes should have /favicon.ico as route"
110+ " app dir - metadata static routes should have /favicon.ico as route" ,
111+ " app dir - metadata static routes should have icons as route"
112+ ]
113+ },
114+ "test/e2e/basepath.test.ts" : {
115+ "flakey" : [
116+ " basePath should not update URL for a 404" ,
117+ " basePath should handle 404 urls that start with basePath"
111118 ]
112119 }
113120 },
You can’t perform that action at this time.
0 commit comments