File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @opennextjs/aws " : patch
3
+ ---
4
+
5
+ fix: make sure edge function entries are properly awaited
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ export default async function edgeFunctionHandler(
17
17
throw new Error ( `No route found for ${ request . url } ` ) ;
18
18
}
19
19
20
- const result = await self . _ENTRIES [
21
- `middleware_ ${ correspondingRoute . name } `
22
- ] . default ( {
20
+ const entry = await self . _ENTRIES [ `middleware_ ${ correspondingRoute . name } ` ] ;
21
+
22
+ const result = await entry . default ( {
23
23
page : correspondingRoute . page ,
24
24
request : {
25
25
...request ,
Original file line number Diff line number Diff line change @@ -37,13 +37,15 @@ export interface RequestData {
37
37
signal : AbortSignal ;
38
38
}
39
39
40
+ interface Entry {
41
+ default : ( props : { page : string ; request : RequestData } ) => Promise < {
42
+ response : Response ;
43
+ waitUntil : Promise < void > ;
44
+ } > ;
45
+ }
46
+
40
47
interface Entries {
41
- [ k : string ] : {
42
- default : ( props : { page : string ; request : RequestData } ) => Promise < {
43
- response : Response ;
44
- waitUntil : Promise < void > ;
45
- } > ;
46
- } ;
48
+ [ k : string ] : Entry | Promise < Entry > ;
47
49
}
48
50
49
51
export interface EdgeRoute {
You can’t perform that action at this time.
0 commit comments