Facing some compatibility Error with PageProps and SearchParamProps #72968
-
SummaryError - This is my page.ts file - type TEntry = typeof import('../../../../../../../app/(root)/events/[id]/update/page.js') type SegmentParams = T extends Record<string, any> // Check that the entry is a valid entry metadata?: any }, TEntry, ''>>() // Check the prop type of the entry function // Check the arguments and return type of the generateMetadata function // Check the arguments and return type of the generateViewport function // Check the arguments and return type of the generateStaticParams function export interface PageProps { } params?: Promise // ============= // If T is unknown or any, it will be an empty {} type. Otherwise, it will be the same as Omit<T, keyof Base>. type FirstArg = T extends (...args: [infer T, any]) => any ? unknown extends T ? any : T : never function checkFields<_ extends { [k in keyof any]: never }>() {} // https://github.com/sindresorhus/type-fest this is my page.tsx file - import CheckoutButton from '@/components/shared/CheckoutButton'; const EventDetails = async ({ params: { id }, searchParams }: SearchParamProps) => { const relatedEvents = await getRelatedEventsByCategory({ return (
) export default EventDetails I tried to change and wrap in promise as well but it is not working and my code is failing while deploying the application , kindly help. Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Do this: const EventDetails = async ({
params,
searchParams,
}: {
params: Promise<{ id: string }>
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
}) => { Make sure that works, and then update your own |
Beta Was this translation helpful? Give feedback.
-
Thank you so much. It worked.
…On Wed, 20 Nov 2024 at 00:15, Joseph ***@***.***> wrote:
Do this:
const EventDetails = async ({
params,
searchParams,}: {
params: Promise<{ id: string }>
searchParams: Promise<{ [key: string]: string | string[] | undefined }>}) => {
Make sure that works, and then update your own SearchParamProps
definition.
—
Reply to this email directly, view it on GitHub
<#72968 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXFLVP2XCOSJBQBJYQ7ATJT2BOBLXAVCNFSM6AAAAABSCZBTD2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMZQHE4TOOI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
No ,i have tried everything but nothing worked.
…On Wed, 25 Dec, 2024, 1:25 am Joseph, ***@***.***> wrote:
Did you fix it? It was exactly the same fix, oddly. Don't forget to await
the params and search params.
—
Reply to this email directly, view it on GitHub
<#72968 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3J6VD22XHGX64UVMD4Q3AL2HG34LAVCNFSM6AAAAABSCZBTD2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRWGAYDCMY>
.
You are receiving this because you commented.Message ID: <vercel/next.
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
It worked.Thank you so much brother.It Is a Part of a nextJs Project on
youtube .i am about to submit it in my current semester.
…On Wed, Dec 25, 2024 at 2:38 AM Joseph ***@***.***> wrote:
The OP to this thread did the updates here,
https://github.com/vijayluxmimaddheshiya/Event_Hub_IGDTUW/blob/main/app%2F%28root%29%2Fevents%2F%5Bid%5D%2Fpage.tsx
Is this part of a course? Oddly similar issue.
—
Reply to this email directly, view it on GitHub
<#72968 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3J6VD5FGSQ5SV27B5HGO5T2HHEN7AVCNFSM6AAAAABSCZBTD2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRWGAZDGNQ>
.
You are receiving this because you commented.Message ID: <vercel/next.
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Nice. Please don't forget to mark as answered!