File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
packages/cloudflare/src/api Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1+ import type { Context , RunningCodeOptions } from "node:vm" ;
2+
13declare global {
24 interface CloudflareEnv {
35 NEXT_CACHE_WORKERS_KV ?: KVNamespace ;
@@ -121,10 +123,14 @@ export async function enableEdgeDevGetCloudflareContext() {
121123
122124 const context = await getCloudflareContextFromWrangler ( ) ;
123125
124- vmModule . runInContext = ( ...args : [ string , RuntimeContext , ...unknown [ ] ] ) => {
125- const runtimeContext = args [ 1 ] ;
126+ vmModule . runInContext = (
127+ code : string ,
128+ contextifiedObject : Context ,
129+ options ?: RunningCodeOptions | string
130+ ) => {
131+ const runtimeContext = contextifiedObject as RuntimeContext ;
126132 runtimeContext [ cloudflareContextInNextDevSymbol ] ??= context ;
127- return originalRunInContext ( ... args ) ;
133+ return originalRunInContext ( code , contextifiedObject , options ) ;
128134 } ;
129135}
130136
You can’t perform that action at this time.
0 commit comments