Replies: 2 comments
-
While waiting for a fix (I really think it's a bug from Next Intl), here is what worked for me :
|
Beta Was this translation helpful? Give feedback.
-
I've just added another test for I'm not sure if what you're encountering is a type problem or a runtime issue? Looking at your fix, it seems like this is a type issue? Maybe the issue you're seeing is that the |
Beta Was this translation helpful? Give feedback.
-
Since I've added the config file and replaced:
Navigation File
import { createLocalizedPathnamesNavigation, Pathnames } from 'next-intl/navigation';
By:
Config File
import {Pathnames, LocalePrefix} from 'next-intl/routing';}
Navigation File
I'm getting this error every time I use the function getPathname(). For example:
The weird thing is that since I added 'next-intl/routing', typescript is telling me that I need to use "query" instead of "params" :
But
query
doesn't seem to work.When I look on the doc or working example, it looks like you are using
params
and notquery
but that doesn't match the type of getPathname() for me…Here is what typescript is telling me:
Object literal may only specify known properties, and 'params' does not exist in type '{ pathname: string; } & { query?: Record<string, SearchParamValue> | undefined; }'.
Wondering if it's a bug. I am really lost here… Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions