Emad KhanEmad Khan

Nextjs 15 Breaking Changes

11/10/2024

Type error: Type 'Props' does not satisfy the constraint 'PageProps'.
  Types of property 'params' are incompatible.
    Type 'Params' is missing the following properties from type 'Promise<any>': then, catch, finally, [Symbol.toStringTag]

This is a breaking change with Nextjs v15 because params is now async.

https://nextjs.org/blog/next-15#async-request-apis-breaking-change
Before:

interface Params {
  id: string;
}
 
export default async function Post({
  params,
}: {
  params: Params;
}) {
  const { id } = params;

After:

interface Params {
  id: string;
}
 
export default async function Post({
  params,
}: {
  params: Promise<Params>; // Note: Promise type
}) {
  const { id } = await params; // Note: await params