Type Error

Hi Vercel Support, I’m experiencing a persistent type error on my Next.js project (versate, dashboard: https://vercel.com/rikhinkavuru-9840s-projects/versate) that blocks all deployments:

Type error: Type ‘{ params: { competitionId: string; }; searchParams?: { | string | undefined; } | undefined; }’ does not satisfy the constraint ‘PageProps’. Types of property ‘params’ are incompatible. Type ‘{ competitionId: string; }’ is missing the following properties from type ‘Promise’: then, catch, finally, [Symbol.toStringTag]

I have already fixed all code and API route signatures (no more Promise types anywhere), deleted, renamed, and even removed the problematic API route (app/api/profiles/[userId]/route.ts), cleared all local caches (.next, node_modules, lock files), cleared the Vercel build cache and redeployed multiple times, and even after deleting the entire [userId] API route directory, the error persists. It seems like Vercel’s internal type cache for dynamic routes is still polluted from a previous bad type signature, and nothing I do locally or in the repo clears it. Can you please clear or reset the type cache for my project so I can deploy? Thank you so much for your help!

The Promise type is the correct one

If you use your type, accessing the params will break at runtime

// Before (causing the error)
export default function Page({ params, searchParams }: {
  params: { competitionId: string }
  searchParams?: { [key: string]: string | undefined }
}) {
  const { competitionId } = params // this will error at runtime
  // ...
}

In Next 15, params and searchParams are promises

// After (correct way)
export default async function Page({ 
  params, 
  searchParams 
}: {
  params: Promise<{ competitionId: string }>
  searchParams: Promise<{ [key: string]: string | string[] | undefined }>
}) {
  const { competitionId } = await params
  const resolvedSearchParams = await searchParams 
  // ...
}

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.