Skip to content

Commit 9a5ef0a

Browse files
authored
fix(cloudflare): bind waitUntil to ctx (#635)
Fix the error "TypeError: Illegal invocation: function called with incorrect `this` reference."
1 parent b999c4e commit 9a5ef0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/open-next/src/overrides/wrappers/cloudflare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const handler: WrapperHandler<
2626
ctx: WorkerContext,
2727
): Promise<Response> => {
2828
globalThis.process = process;
29-
globalThis.openNextWaitUntil = ctx.waitUntil;
29+
globalThis.openNextWaitUntil = ctx.waitUntil.bind(ctx);
3030

3131
// Set the environment variables
3232
// Cloudflare suggests to not override the process.env object but instead apply the values to it

0 commit comments

Comments
 (0)