Currently, I am working with Next.js version 15. In my code, I define my page in the following manner:
export default async function Page({ params }: { params: { slug: string[] } })
{ ... }
However, during the project build process, I encounter the following error message:
Type error: Type '{ params: { slug: string[]; }; }' does not satisfy the constraint 'PageProps'.
Types of property 'params' are incompatible.
Type '{ slug: string[]; }' is missing the following properties from type 'Promise<any>': then, catch, finally, [Symbol.toStringTag]
I have tried to resolve the types or ignore this error using a comment
// @ts-expect-error: params type does not match expected PageProps
, but unfortunately it does not help in ignoring this error.
Could someone please guide me on what mistake I might be making? Any assistance would be greatly appreciated. Thank you, Stackoverflow!