From 8c924c0b27909a312a2bb3226f1a2d309185a283 Mon Sep 17 00:00:00 2001 From: Atash03 Date: Sat, 24 Jan 2026 16:48:35 +0500 Subject: [PATCH] fix: await params in dynamic route for Next.js 15 compatibility In Next.js 15, dynamic route params are now Promises and must be awaited before accessing properties. --- app/(main)/treasury/[video_id]/page.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/(main)/treasury/[video_id]/page.tsx b/app/(main)/treasury/[video_id]/page.tsx index e37d480..64e142c 100644 --- a/app/(main)/treasury/[video_id]/page.tsx +++ b/app/(main)/treasury/[video_id]/page.tsx @@ -10,20 +10,21 @@ import { Suspense } from 'react'; import Loader from '@/components/Loader'; interface IParams { - params: { + params: Promise<{ video_id: number; category_id: string; content_url: string; banner_url: string; - }; + }>; } const VideoItem = async ({ params }: IParams) => { + const { video_id } = await params; const queryClient = getQueryClient(); await queryClient.prefetchQuery({ - queryKey: ['video', `video:${params.video_id}`], - queryFn: () => Queries.getVideo(params.video_id), + queryKey: ['video', `video:${video_id}`], + queryFn: () => Queries.getVideo(video_id), }); await queryClient.prefetchInfiniteQuery({ queryKey: ['video', 'all'], @@ -57,7 +58,7 @@ const VideoItem = async ({ params }: IParams) => { }> - +