Running "next build" locally and "vercel build" both work smoothly. However, once deployed to vercel, the "Linting and checking validity of types" fails during the build process. It seems like TypeScript is stricter when building on vercel even with the same codebase setup.
The app is built on create-t3 framework. The build process halts on vercel whenever a "select" statement is added in a prisma findUnique query, like in the "check-credentials" file.
On the vercel console, the following error is displayed:
info - Linting and checking validity of types...
Failed to compile.
./src/pages/api/user/check-credentials.ts:33:7
Type error: Type '{ id: true; name: true; email: true; image: true; password: true; }' is not assignable to type 'UserSelect'.
Object literal may only specify known properties, and 'password' does not exist in type 'UserSelect'.
31 | email: true,
32 | image: true,
> 33 | password: true,
| ^
34 | },
35 | });
36 | if (user && user.password == hashPassword(req.body.password)) {
To troubleshoot this issue, I have created a repository clone as it appears that there might be an issue with local ts validation and linting being overlooked compared to deployments: https://github.com/Andreaswt/t3-app