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

Testing MatDialog functions in Angular: Learning how to open and close dialogues

I am currently facing an issue with testing the MatDialog open and close functions. No matter what I try, I cannot seem to successfully test either the open or close functions. I am wondering how I can mock these functions in order to properly test them. W ...

Issue encountered in Next.js: "The specified file is not a valid image for rendering."

Currently, I am working through the Next.js tutorial (specifically this one). Below is a simplified version of the code from the tutorial for better understanding: /pages/posts/first-post.js import Link from 'next/link'; import Head from 'n ...

Error with Angular 2 observables in TypeScript

When a user types a search string into an input field, I want to implement a debounce feature that waits for at least 300 milliseconds before making a request to the _heroService using HTTP. Only modified search values should be sent to the service (distin ...

An unexpected error has occurred: Uncaught promise rejection with the following message: Assertion error detected - The type provided is not a ComponentType and does not contain the 'ɵcmp' property

I encountered an issue in my Angular app where a link was directing to an external URL. When clicking on that link, I received the following error message in the console: ERROR Error: Uncaught (in promise): Error: ASSERTION ERROR: Type passed in is not Co ...

The library "vue-property-decorator" (v10.X) is causing issues with resolving in Webpack despite being successfully installed

Encountered an error message Module not found: Error: Can't resolve './decorators/Emit' while attempting to import functionality from the library vue-property-decorator. The package is installed and accessible, ruling out a simple installati ...

Ways to display "No records" message when the filter in the material table in Angular returns no results

How can I implement a "No Records Message" for when the current table is displaying empty data? Check out this link for examples of material tables in AngularJS: https://material.angular.io/components/table/examples ...

What is the best method for showcasing information within an Angular Material table?

When using Angular material to display a list, I am facing an issue where the content of the list is not being displayed but the header is. Component: export class CompaniesComponent implements OnInit { displayedColumns: string[] = ['id']; ...

How can I effectively manage 404 errors when dealing with dynamically-fetched routes in NextJs?

Let's consider a scenario where we have a dynamic route such as "exercise/[id]/". Upon accessing this route, we extract the id from the URL in the following manner: const router = useRouter() const id = router.query.id Subsequently, a client side fet ...

TypeScript does not recognize the $.ajax function

Looking for help with this code snippet: $.ajax({ url: modal.href, dataType: 'json', type: 'POST', data: modal.$form.serializeArray() }) .done(onSubmitDone) .fail(onSubmitFail); ...

A step-by-step guide on configuring data for aria's autocomplete feature

Currently, I am implementing aria autocomplete and facing an issue while trying to populate data from the server into the selection of aria autocomplete. I have tried setting the selected property of the aria autocomplete object, but it doesn't seem t ...

Having trouble incorporating @types/pdfmake into an Angular project

I have been experimenting with integrating a JS library called pdfmake into an Angular application. I found some guidance on how to accomplish this at https://www.freecodecamp.org/news/how-to-use-javascript-libraries-in-angular-2-apps/, which involved usin ...

The Angular HttpClient Service will exclusively provide responses that have a status code of 200

I'm facing an issue with my login component where it calls an http client service to send a request to the server for logging in. Everything works smoothly when I enter valid credentials, but if I input wrong credentials, the service doesn't seem ...

Developing a dynamic API route in Next.js: A step-by-step guide

My goal is to create a dynamic route in the api folder for processing GET requests. Initially, everything works smoothly with the route api/[product]. const baseUrl ='https://myUrl' const { product } = req.query const url = `${baseUrl}/${pro ...

The function in Angular 5/Typescript disappears when attempting to call it from within another function

After importing D3 into my component, I encounter an issue when trying to assign a layout to the D3.layout property. Strangely, although the layout property is present in the console output of my D3 object, it seems to be unknown when I attempt to call i ...

The element event does not trigger an update on the view

I am trying to display the caret position of my editor on a specific place on the website. I have created a directive and service to share variables between the controller and directive. Inside the directive, I have enabled events like "keyup", "mouseup", ...

Tips for changing the size and color of SVG images in a NextJS application

Looking to customize the color and size of an svg image named "headset.svg". Prior to this, I used next/image: <Image src={'/headset.svg'} alt='logo' width={30} height={30} className='object-contain' /> The s ...

Send search engines to a particular route, like 'mydomain.com/somepath'

My website is built using Next.js. I am aiming to have the main application on the index route: ...mydomain.com/. However, I also want a dedicated landing page at route: ...mydomain.com/mylandingpage. My question revolves around how to inform search eng ...

Error: Unable to locate the type definition file for the '@babel' package

I am currently working on a new project and here is the content of my package.json file. { "name": "dapp-boilerplate", "version": "1.0.0", "main": "index.js", "license": "MI ...

Once a value is assigned, the form components in Next.js cannot be edited

Having trouble with a form functionality that is causing the text input to be disabled when setting the state for the input value. This issue is occurring within a specific page of my Next.js project. <Form.Field> <label>Product Name</la ...

What sets apart .to and .toService in InversifyJS?

I find the documentation on using .toService(MyClass) for transitive bindings confusing. The examples provided also show that achieving the same result is possible with a regular .to(MyClass). https://github.com/inversify/InversifyJS/blob/master/wiki/tran ...