File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,20 @@ export async function onBuildComplete(
119119
120120 globalThis.AsyncLocalStorage = AsyncLocalStorage
121121
122+ const RouterServerContextSymbol = Symbol.for(
123+ '@next/router-server-methods'
124+ );
125+
126+ if (!globalThis[RouterServerContextSymbol]) {
127+ globalThis[RouterServerContextSymbol] = {};
128+ }
129+
130+ globalThis[RouterServerContextSymbol]['.'] = {
131+ revalidate: (...args) => {
132+ console.log('revalidate called with args:', ...args);
133+ }
134+ }
135+
122136 const require = createRequire(import.meta.url)
123137
124138 const pathnameToEntry = ${ JSON . stringify ( pathnameToEntry , null , 2 ) }
Original file line number Diff line number Diff line change @@ -72,6 +72,14 @@ type NextHandler = (
7272 } ,
7373) => Promise < void | null >
7474
75+ function addRequestMeta ( req : IncomingMessage , key : string , value : any ) {
76+ const NEXT_REQUEST_META = Symbol . for ( 'NextInternalRequestMeta' )
77+ const meta = ( req as any ) [ NEXT_REQUEST_META ] || { }
78+ meta [ key ] = value
79+ ; ( req as any ) [ NEXT_REQUEST_META ] = meta
80+ return meta
81+ }
82+
7583export async function runNextHandler (
7684 request : Request ,
7785 context : Context ,
@@ -95,6 +103,8 @@ export async function runNextHandler(
95103 } ,
96104 } )
97105
106+ addRequestMeta ( req , 'relativeProjectDir' , '.' )
107+
98108 disableFaultyTransferEncodingHandling ( res as unknown as ComputeJsOutgoingMessage )
99109
100110 nextHandler ( req , res , {
You can’t perform that action at this time.
0 commit comments