Vercel encountered issues with "validating code quality and type correctness" during deployment but was successful when performed locally

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

Answer №1

It appears that there is an issue with your Prisma schema compilation in CI generating a different output compared to your local Prisma schema compilation. Although I'm not well-versed in t3, it seems like altering the Prisma schema without recompiling the underlying Prisma client is causing errors. To ensure backend functionality aligns with your schema changes, consider running db-generate-client.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Bringing in the RangeValue type from Ant Design package

Currently working on updating the DatePicker component in Ant Design to use date-fns instead of Moment.js based on the provided documentation, which appears to be functioning correctly. The suggested steps include: import dateFnsGenerateConfig from ' ...

Sharing information from Directive to Component in Angular

Here is a special directive that detects key strokes on any component: import { Directive, HostListener } from '@angular/core'; @Directive({ selector: '[keyCatcher]' }) export class keyCatcher { @HostListener('document:keydo ...

Facing a problem with NEXTJS api, axios, and NextAuth: AxiosError occurs due to connection being refused on ::1:3000

In my Next.js application, I am implementing NextAuth for authentication. To make API calls within the same app using axios, I need to specify the verify_url correctly. When I use "http://localhost:3000" in the verify_url and load the app in dev mode, ever ...

Vue composable yields a string value

I am currently using a Vue composable method that looks like this: import { ref } from 'vue'; const useCalculator = (num1: number, num2: number, operation: string) => { const result = ref(0); switch (operation) { case 'add& ...

Understanding how to incorporate third party HTML tags into your React project

Is there a method to incorporate appearing animations using the useInView hook? The obstacle I am facing is that the necessary tag is not present in my code; instead, it is retrieved as a single tag from a third party Ghost through dangerouslySetInnerHTML. ...

Is it necessary to use both observer.unobserve and observer.disconnect at the same time?

Is it unnecessary to use both observer.unobserve and observer.disconnect together? Should I just stick with one of them? I have implemented the IntersectionObserver within a useEffect. The code snippet provided is the clean-up function for that useEffect. ...

Steps for making a "confirm" button within a modal that includes a redirect URL

I have developed a modal that, upon clicking on the confirm button, should redirect the user to the page titled securities-in-portfolio. modal <div class="modal-footer justify-content-center"> <button type="button" class ...

Leveraging AWS Next.js with EC2 for optimized content caching

My plan involves using Next.js for server-side rendering (SSR), static site generation (SSG), and incremental static regeneration (ISR) on Amazon's EC2, with image storage on an S3 Bucket. Additionally, I intend to implement CloudFront as a content de ...

Ways to activate auto completion without using a string

Can anyone assist us with the tinymce editor? We have implemented an auto completion feature using a plugin from TinyMCE's documentation, but we are having trouble changing the triggering behavior. Currently, it only suggests options when "@" is typed ...

InitAuth0 Auth0 encountering deepPartial error in Next.js with TypeScript setup

Having some trouble setting up auth0 with nextjs using typescript. When I try to initialize Auth0, I encounter an error regarding deep partials, Argument of type '{ clientId: string; clientSecret: string; scope: string; domain: string; redirectUri: st ...

Water supply running low in the nextJS Vercel project

An error message is displayed below. After rendering your application in NextJS, there appears to be a discrepancy between the pre-rendered React tree (SSR/SSG) and the one rendered during the initial browser render. This process, known as Hydration, is a ...

Tips for creating a reusable component using react-hook and yup?

Here is the code I have written: https://github.com/robokonk/react-hook-component/blob/main/pages/index.tsx I am working on creating a reusable input component with validation. Can anyone suggest corrections to improve it? Currently, I am facing an issue ...

An error has been detected: An unexpected directive was found. Kindly include a @NgModule annotation

I am encountering an issue while trying to import a class into a module in my Ionic/Angular app. Upon attempting to release, the following error message appears: ERROR in : Unexpected directive 'SeedModalPage in /home/robson/Lunes/repositories/bolunes ...

Unlocking superior performance with AWS Amplify and NextJS 12 - The Surprising Fluctuation in Backend

My recent experience with AWS Amplify and Next.js 12 involved accepting a "performance improvement" that initially seemed successful. However, an unexpected issue arose where everything became linked to my dev backend environment post-performance improveme ...

Tips for styling the Button component in the shadcn/ui library for maximum impact

I'm currently working on a project using the shadcn/ui library. How can I properly customize it to meet my specific needs? For example, let's say I require an extra large red rounded Button for a call-to-action button in my project. What would be ...

hide elements only when there is no string to display in Angular2/Typescript

As I experiment with my javascript/typescript code, I've encountered an issue where a string is displayed letter by letter perfectly fine. However, once the entire string is shown, the element containing it disappears and allows the bottom element to ...

"Unsuccessful API request leads to empty ngFor loop due to ngIf condition not being

I have been struggling to display the fetched data in my Angular 6 project. I have tried using ngIf and ngFor but nothing seems to work. My goal is to show data from movies on the HTML page, but for some reason, the data appears to be empty. Despite tryin ...

Links in Next.js fail to function properly after deploying on Firebase

I recently deployed my project on Firebase, but I'm encountering an issue with the links not functioning correctly. Everything works fine when tested locally, with paths like /account working as expected. However, after deployment, only /account.html ...

Tab-based Ionic 2 advertising campaign featuring banners

Is there a way to incorporate an advertisement banner image above the tabs in ionic 2? Any suggestions on how I can achieve this or create the banner in that specific position? ...

Confirm the existence of a non-null value

One of the functions I have implemented is designed to remove null values from an array that is passed as input. This function also provides an optional transform functionality, allowing the user to modify the elements of the array into a custom format if ...