Closed Rheaparks closed 3 months ago
I need to use the same dynamic param twice. But even if it is the same param, the getPathname() is asking two params. I can't obviously enter the same param twice… Is it my mistake?
Here is the pathname code:
"/seo/things-to-do/[countrySlug]": { en:"/[countrySlug]/things-to-do-[countrySlug]", fr:"/[countrySlug]/que-faire-[countrySlug]", },
The error:
Error: Insufficient params provided for localized pathname. Template: /[countrySlug]/que-faire-[countrySlug] Params: {"countrySlug":"france"}
https://github.com/amannn/next-intl-bug-repro-app-router
Steps to reproduce:
On environment { Pathnames } next-intl/routing
Create a pathname with config or navigation.ts like this:
Create app > [locale] > seo > things-to-do > [countrySlug] > page.tsx
Call:
const path = getPathname({ locale: locale, href: { pathname: "/seo/things-to-do/[countrySlug]" params: { countrySlug: "france" } }, } as any);
See error:
We enter only one param, since it is the same param called twice.
Thanks for the report! A fix is coming in https://github.com/amannn/next-intl/pull/1259
Description
I need to use the same dynamic param twice. But even if it is the same param, the getPathname() is asking two params. I can't obviously enter the same param twice… Is it my mistake?
Here is the pathname code:
The error:
Verifications
Mandatory reproduction URL
https://github.com/amannn/next-intl-bug-repro-app-router
Reproduction description
Steps to reproduce:
On environment { Pathnames } next-intl/routing
Create a pathname with config or navigation.ts like this:
Create app > [locale] > seo > things-to-do > [countrySlug] > page.tsx
Call:
See error:
Expected behaviour
We enter only one param, since it is the same param called twice.