BlairCurrey / trpc-koa-adapter

Add trpc to your koa server
https://www.npmjs.com/package/trpc-koa-adapter
MIT License
22 stars 5 forks source link

Setting response cookies #21

Open anton-johansson opened 1 year ago

anton-johansson commented 1 year ago

Hey!

I'm messing around with this library, and realized that res from the example shows up as any for me. Any idea why? See below:

image

EDIT: The reason I'm asking is because I'd like to set a response cookie. I'm trying to create a tRPC procedure for logging in, and therefore I need to set a cookie. :)

BlairCurrey commented 1 year ago

Hi @anton-johansson, would you be able to paste a code snippet with more context, including how you are importing CreateTrpcKoaContextOptions? CreateTrpcKoaContextOptions was added in trpc-koa-adapter version 1.1.2. I tested against this locally and it is typed as expected when doing import { CreateTrpcKoaContextOptions } from 'trpc-koa-adapter';

brncsk commented 10 months ago

This depends on your version of @types/node as ServerResponse is not generic in @types/node@^16 . Installing @^18 solves the problem for me.