I'm deploying a Next.js 15.3.3 app to Vercel and encountering a TypeScript error related to dynamic route parameters. The error says: "Type '{ params: { questionId: string; questionSlug: string; }; }' does not satisfy the constraint 'PageProps'. Type '{ questionId: string; questionSlug: string; }' is missing the following properties from type 'Promise': then, catch, finally..."
It seems like Next.js expects params to be a Promise, which doesn't make sense. I’m using the App Router, and my page function looks like:
export default async function Page({ params }: { params: { questionId: string; questionSlug: string } }) { ... }
I tried wrapping params in await Promise.resolve() but that didn't help either. This only occurs during the Vercel production build, not locally. How can I fix this?
I expected the params object to be directly available in the Page and Layout functions as usual in the Next.js App Router. I tried explicitly typing the function argument as { params: { questionId: string; questionSlug: string } }, and also tried wrapping params in await Promise.resolve(params) as a workaround, thinking maybe Vercel expects a resolved Promise. However, neither helped — the Vercel build still fails, saying that params is expected to be a Promise. Locally, everything works perfectly and there are no TypeScript errors during development or local production builds.