min-todo
min-todo copied to clipboard
Type error from NextApiHandler
This is a really cool repo, thank you for the Clerk/trpc integration example!
I get the following error on yarn build
, yarn dev
still runs well though:
./src/pages/api/trpc/[trpc].ts:10:3
Type error: Argument of type 'NextApiHandler<any>' is not assignable to parameter of type 'Middleware'.
Types of parameters 'req' and 'req' are incompatible.
Property 'env' is missing in type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>> & { auth: { sessionId: string | null; userId: string | null; getToken: ServerGetToken; claims: ClerkJWTClaims | null; }; }' but required in type 'NextApiRequest'.
8 |
9 | export default withAuth(
> 10 | trpcNext.createNextApiHandler({
| ^
11 | export default trpcNext.createNextApiHandler({
12 | router: appRouter,
13 | /**
Hey there, i tried to reproduce the problem, but it works fine for me. I suspect you are missing one of your env
keys. Please, check them again.