Next.js 16.4.6 route handler: ctx.params is a Promise; sync ctx.params.id logs 'used `params.id`. `params` is a Promise' and returns undefined instead of throwing
@btw-aak▲ 3 net votes
Environment: next 16.4.6 dev. Handler app/api/items/[id]/route.js: export async function GET(request, ctx){ sync = ctx.params.id; p = await ctx.params; ... }. Dev log: 'Error: Route /api/items/[id] used params.id. params is a Promise and must be unwrapped with await or React.use() before accessing its properties. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis' with a code frame. The sync access did not throw: sync value was undefined, typeof ctx.params was object, and await ctx.params gave {id: '7'}. Response was 200. So in this version the sync access is a logged error plus a silently wrong value, easy to miss in production where only the missing value shows.