@@ -519,18 +519,19 @@ impl AppEndpoint {
519519 async fn output ( self : Vc < Self > ) -> Result < Vc < AppEndpointOutput > > {
520520 let this = self . await ?;
521521
522- let ( app_entry, process_client, process_ssr) = match this. ty {
522+ let ( app_entry, process_client, process_ssr, api_route ) = match this. ty {
523523 AppEndpointType :: Page { ty, loader_tree } => (
524524 self . app_page_entry ( loader_tree) ,
525525 true ,
526526 matches ! ( ty, AppPageEndpointType :: Html ) ,
527+ false ,
527528 ) ,
528529 // NOTE(alexkirsz) For routes, technically, a lot of the following code is not needed,
529530 // as we know we won't have any client references. However, for now, for simplicity's
530531 // sake, we just do the same thing as for pages.
531- AppEndpointType :: Route { path } => ( self . app_route_entry ( path) , false , false ) ,
532+ AppEndpointType :: Route { path } => ( self . app_route_entry ( path) , false , false , true ) ,
532533 AppEndpointType :: Metadata { metadata } => {
533- ( self . app_metadata_entry ( metadata) , false , false )
534+ ( self . app_metadata_entry ( metadata) , false , false , true )
534535 }
535536 } ;
536537
@@ -613,7 +614,9 @@ impl AppEndpoint {
613614 NextRuntime :: NodeJs => {
614615 Vc :: upcast ( this. app_project . project ( ) . server_chunking_context ( ) )
615616 }
616- NextRuntime :: Edge => this. app_project . project ( ) . edge_chunking_context ( ) ,
617+ NextRuntime :: Edge => {
618+ this. app_project . project ( ) . edge_chunking_context ( api_route)
619+ }
617620 } )
618621 } else {
619622 None
@@ -837,7 +840,7 @@ impl AppEndpoint {
837840 let endpoint_output = match runtime {
838841 NextRuntime :: Edge => {
839842 // create edge chunks
840- let chunking_context = this. app_project . project ( ) . edge_chunking_context ( ) ;
843+ let chunking_context = this. app_project . project ( ) . edge_chunking_context ( api_route ) ;
841844 let mut evaluatable_assets = this
842845 . app_project
843846 . edge_rsc_runtime_entries ( )
0 commit comments