Skip to content

Commit df0f6bc

Browse files
authored
fix: clientContext isn't available in background functions (#2121)
1 parent b31f858 commit df0f6bc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/runtime/src/templates/getApiHandler.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ const makeApiHandler = ({ conf, app, pageRoot, NextServer }: MakeApiHandlerParam
7070
return bridge
7171
}
7272

73-
const {
74-
clientContext: { custom: customContext },
75-
} = context
73+
const customContext = context.clientContext?.custom
7674

7775
// Scheduled functions don't have a URL, but we need to give one so Next knows the route to serve
7876
const url = event.rawUrl ? new URL(event.rawUrl) : new URL(path, process.env.URL || 'http://n')

0 commit comments

Comments
 (0)