Getting This error after upgrading from nextjs 14 to nextjs15.
Unanswered
Tonkinese posted this in #help-forum
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;
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
params and searchParams are now async
@Tonkinese
TonkineseOP
Thank you so much @James4u it fixed it.
glad to help you!
Mark solution if it helped you 🙂
Mark solution if it helped you 🙂
@Tonkinese