Next.14 Build Error – OmitWithTag

  Kiến thức lập trình

I’m using Next.14 to develop an app and in the Build process it always ends the process like this here:

C:UsersHPDocumentsUPnext-auth>npm run build

> [email protected] build
> next build

  ▲ Next.js 14.2.3
  - Environments: .env

   Creating an optimized production build ...
 ✓ Compiled successfully
   Linting and checking validity of types  ...Failed to compile.

.next/types/app/api/auth/actions/route.ts:8:13
Type error: Type 'OmitWithTag<typeof import("C:/Users/HP/Documents/UP/next-auth/app/api/auth/actions/route"), "POST" | "config" | "generateStaticParams" | "revalidate" | "dynamic" | "dynamicParams" | "fetchCache" | ... 8 more ... | "PATCH", "">' does not satisfy the constraint '{ [x: string]: never; }'.
  Property 'Login' is incompatible with index signature.
    Type '(email: string, password: string) => Promise<void>' is not assignable to type 'never'.

   6 |
   7 | // Check that the entry is a valid entry
>  8 | checkFields<Diff<{
     |             ^
   9 |   GET?: Function
  10 |   HEAD?: Function
  11 |   OPTIONS?: Function

I separated all the server-components into different files and consulted the build file but I didn’t find anything that could be useful other than this message

 Type 'OmitWithTag<typeof import("C:/Users/HP/Documents/UP/next-auth/app/api/auth/actions/route"), "POST" | "config" | "generateStaticParams" | "revalidate" | "dynamic" | "dynamicParams" | "fetchCache" | ... 8 more ... | "PATCH", "">' does not satisfy the constraint '{ [x: string]: never; }'.
  Property 'Login' is incompatible with index signature.
    Type '(email: string, password: string) => Promise<void>' is not assignable to type 'never'.

It says that the parameters being passed do not correspond to the Never type.

Can you tell me how to solve this problem?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT