Hello, I’m trying to deploy my Next.js application to Vercel, but I’m encountering a build error related to a specific API route. The error message indicates that there was a failure in collecting page data for /api/favourites/[drivingSchoolId], and the build process exits with code 1. Below is the relevant part of the error log:
Error message:
at fa (/vercel/path0/node_modules/@prisma/client/runtime/library.js:33:69)
at new t (/vercel/path0/node_modules/@prisma/client/runtime/library.js:131:739)
at 13543 (/vercel/path0/.next/server/app/api/favourites/[drivingSchoolId]/route.js:1:3921)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:128)
at 91782 (/vercel/path0/.next/server/app/api/favourites/[drivingSchoolId]/route.js:1:2942)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:128)
at 40100 (/vercel/path0/.next/server/app/api/favourites/[drivingSchoolId]/route.js:1:1267)
at t (/vercel/path0/.next/server/webpack-runtime.js:1:128)
at t (/vercel/path0/.next/server/app/api/favourites/[drivingSchoolId]/route.js:1:4006)
at /vercel/path0/.next/server/app/api/favourites/[drivingSchoolId]/route.js:1:4041 {
clientVersion: '5.16.2',
errorCode: undefined
}
> Build error occurred
Error: Failed to collect page data for /api/favourites/[drivingSchoolId]
at /vercel/path0/node_modules/next/dist/build/utils.js:1268:15
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
type: 'Error'
}
Error: Command "npm run build" exited with 1