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<
127127 protected createRequest ( initialConfig : { method : string ; url : string } ) {
128128 return async (
129129 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+ } ,
131135 ) => {
132136 const { method : _method , url : _url , ...initial } = initialConfig ;
133137 const url = req . url ;
@@ -155,7 +159,11 @@ export class NextRoute<
155159 ...initial ,
156160 input,
157161 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 ,
159167 rawRequest : req ,
160168 method,
161169 url,
You can’t perform that action at this time.
0 commit comments