File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,11 @@ export class NextRoute<
127
127
protected createRequest ( initialConfig : { method : string ; url : string } ) {
128
128
return async (
129
129
req : NextRequest ,
130
- route : { params : Record < string , string | string [ ] > } ,
130
+ route : {
131
+ params :
132
+ | Record < string , string | string [ ] >
133
+ | Promise < Record < string , string | string [ ] > > ;
134
+ } ,
131
135
) => {
132
136
const { method : _method , url : _url , ...initial } = initialConfig ;
133
137
const url = req . url ;
@@ -155,7 +159,11 @@ export class NextRoute<
155
159
...initial ,
156
160
input,
157
161
parsedInput : undefined ,
158
- pathParams : route ?. params ,
162
+ pathParams :
163
+ // in nextjs 15, route.params is a promise
164
+ typeof route ?. params ?. then === 'function'
165
+ ? await route . params
166
+ : route ?. params ,
159
167
rawRequest : req ,
160
168
method,
161
169
url,
You can’t perform that action at this time.
0 commit comments