Next.js Discord

Discord Forum

Getting This error after upgrading from nextjs 14 to nextjs15.

Unanswered
Tonkinese posted this in #help-forum
Open in Discord
Avatar
TonkineseOP
app/EditProduct/[id]/page.tsx
Type error: Type 'PageProps' does not satisfy the constraint 'import("/home/runner/work/yggdrasil/yggdrasil/apps/dashboard/.next/types/app/EditProduct/[id]/page").PageProps'.
Types of property 'params' are incompatible.
Type '{ id: string; }' is missing the following properties from type 'Promise<any>': then, catch, finally, [Symbol.toStringTag]
/app/edit-product/[id]/page.tsx
import EditProductComponent from "@/components/EditProduct";

interface PageProps {
params: {
id: string;
};
}

const Page: React.FC<PageProps> = ({ params }) => {
return <EditProductComponent id={params.id} />;
};

export default Page;

6 Replies

Avatar
params and searchParams are now async
@Tonkinese
Avatar
TonkineseOP
Thank you so much @James4u it fixed it.
Avatar
glad to help you!
Mark solution if it helped you 🙂
@Tonkinese