│ Type '({ req, res, }: { req: Request; res: Response; }) => CreateInnerContextOpts' is not assignable to type 'NodeHTTPCreateContextFn<CreateRouterInner<RootConfig<{ ctx: CreateInnerContextOpts; meta: object; errorShape: { data: { zodError: typeToFlattenedError<any, string> | null; code: "PARSE_ERROR" | ... 13 more ... | "CLIENT_CLOSED_REQUEST"; httpStatus: number; path?: string | undefined; stack?: string | undefined; }; me...'. typescript (2322) [12, 3]
│ Types of parameters '__0' and 'opts' are incompatible.
│ Type 'NodeHTTPCreateContextFnOptions<IncomingMessage, WebSocket>' is not assignable to type '{ req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>; res: Response<any, Record<string, any>>; }'.
│ Types of property 'req' are incompatible.
│ Type 'IncomingMessage' is missing the following properties from type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>': get, header, accepts, acceptsCharsets, and 26 more.
│ Type '({ req, res, }: { req: Request; res: Response; }) => CreateInnerContextOpts' is not assignable to type 'NodeHTTPCreateContextFn<CreateRouterInner<RootConfig<{ ctx: CreateInnerContextOpts; meta: object; errorShape: { data: { zodError: typeToFlattenedError<any, string> | null; code: "PARSE_ERROR" | ... 13 more ... | "CLIENT_CLOSED_REQUEST"; httpStatus: number; path?: string | undefined; stack?: string | undefined; }; me...'. typescript (2322) [12, 3]
│ Types of parameters '__0' and 'opts' are incompatible.
│ Type 'NodeHTTPCreateContextFnOptions<IncomingMessage, WebSocket>' is not assignable to type '{ req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>; res: Response<any, Record<string, any>>; }'.
│ Types of property 'req' are incompatible.
│ Type 'IncomingMessage' is missing the following properties from type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>': get, header, accepts, acceptsCharsets, and 26 more.
does anyone know how can I fix this and make it compatible with my opts?
I am using trpc with nextjs but when I am using hooks they're just not returning anything? Like it makes the request but it goes as pending and just blocks everything
console.log("✅ WebSocket Server listening on ws://localhost:3001");
process.on("SIGTERM", () => {
console.log("SIGTERM");
handler.broadcastReconnectNotification();
wss.close();
});
I have something like this atp in very early stage of trying websocket this is how my server looks rn. The connection isn't started for some reason on the server 🤔