From a5103d2e348f392b54fb3b6abe8ef21aae481598 Mon Sep 17 00:00:00 2001 From: Preston Richey Date: Wed, 13 Apr 2022 19:08:53 -0400 Subject: [PATCH] Add support for catch-all route params in NextRequest page type declaration (#36137) fixes https://github.com/vercel/next.js/issues/36136 ## Bug - [X] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint` --- packages/next/server/web/spec-extension/request.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/server/web/spec-extension/request.ts b/packages/next/server/web/spec-extension/request.ts index 61d86ef40652..b4b20424f116 100644 --- a/packages/next/server/web/spec-extension/request.ts +++ b/packages/next/server/web/spec-extension/request.ts @@ -13,7 +13,7 @@ export class NextRequest extends Request { cookieParser(): { [key: string]: string } geo: RequestData['geo'] ip?: string - page?: { name?: string; params?: { [key: string]: string } } + page?: { name?: string; params?: { [key: string]: string | string[] } } ua?: UserAgent | null url: NextURL } @@ -105,7 +105,7 @@ export interface RequestInit extends globalThis.RequestInit { } page?: { name?: string - params?: { [key: string]: string } + params?: { [key: string]: string | string[] } } }