While the former's explaination is correct, the code still has a mistake since it needs to be awaited on params
before accessing the attribute.
export async function GET(
request: Request,
{params}: { params: Promise<{ id: string }> }
) {
const id = (await params).id
// rest of your code
}