joschan21 / quill

Quill - A Modern SaaS-Platform Built With Next.js 13
1.91k stars 513 forks source link

kindeAuth/route.ts Error when deploying to Vercel #54

Closed ck18sss closed 11 months ago

ck18sss commented 11 months ago

I am getting an error in kindeAuth/route.ts when I deploy to Vercel.

image Failed to compile. -- 13:43:41.548 |   13:43:41.549 | src/app/api/auth/[kindeAuth]/route.ts 13:43:41.549 | Type error: Route "src/app/api/auth/[kindeAuth]/route.ts" has an invalid export: 13:43:41.549 | "Promise<(req: any, res: any) => any>" is not a valid GET return type: 13:43:41.549 | Expected "void \| Response \| Promise", got "Promise<(req: any, res: any) => any>". 13:43:41.550 | Expected "Promise", got "Promise<(req: any, res: any) => any>". 13:43:41.550 | Expected "void \| Response", got "(req: any, res: any) => any". 13:43:41.550 |   13:43:41.702 | Error: Command "npm run build" exited with 1

It works fine in the local environment. Here is my repository: https://github.com/ck18sss/InquireAI_v2

This is the code in kindeAuth:

import { handleAuth } from '@kinde-oss/kinde-auth-nextjs/server'
import { NextRequest } from 'next/server'

export async function GET(
  request: NextRequest,
  { params }: any
) {
  const endpoint = params.kindeAuth
  return handleAuth(request, endpoint)
}
ck18sss commented 11 months ago

Getting more type errors unfortunately, when trying to deploy.

image
purnellbp commented 11 months ago

Kinde changed some things. I just used their example repo and made a few changes. kinde-nextjs-app-router-starter-kit

Things to take notice:

export const GET = handleAuth();