Linting errors when building on Vercel that I'm not getting on local machine
Hi all,
My build on Vercel is failing because of linting errors. The weird thing is, I'm not getting these errors when building locally at all. This is an excerpt from the build error I'm getting on Vercel:
The errors seem to indicate that I am unsafely assigning values with type "any" and that I am unsafely accessing properties of those values in other files. These errors happen in files that are related to or use Prisma, but when I check these files, there are no "any" types in the files at all.
For reference, here's the server/db.ts file that is giving errors:
When hovering over the variables in my editor (VS Code), everything seems to have a proper type. As mentioned before, the build does not fail on my local machine, but does on Vercel.
I am asking this question here, because this project was generated using the create-t3-app cli. I hope someone can help me. Please let me know if this question is better to ask elsewhere.
1 Reply
I am not yet marking this as the solution, because I am still confused, but...
I happen to have found a fix in the meantime. I changed the build script in my package.json file. Before it runs
next build
it now first runs npx prisma generate
. This seems to have fixed the linting errors.
What I don't understand is what the linting errors in the server/db.ts file have to do with this fix. To me it seems I shouldn't need to generate the prisma client before the build to prevent those linting errors. As mentioned in my post, when hovering over the values in this file in my editor, there were no "any" types to be found.