You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library currently does not seem to be compatible with Deno.serve. It throws the following error:
Deno: No overload matches this call. Overload 1 of 3, '(handler: ServeHandler): Server', gave the following error. Argument of type '(req: Request, connInfo: ConnInfo) => Response | Promise' is not assignable to parameter of type 'ServeHandler'. Overload 2 of 3, '(options: ServeInit & (ServeOptions | ServeTlsOptions)): Server', gave the following error. Argument of type '(req: Request, connInfo: ConnInfo) => Response | Promise' is not assignable to parameter of type 'ServeInit & (ServeOptions | ServeTlsOptions)'.
This workaround works for me until it is being fixed
// Use io.handler() directly once it allows using parameter ServeHandlerInfo instead of ConnInfo.constcustomIOHandler: Deno.ServeHandler=(request: Request,info: Deno.ServeHandlerInfo)=>{constlocalAddr: Deno.Addr={transport: "tcp",hostname: HOSTNAME,port: PORT,};constconnInfo: ConnInfo={remoteAddr: info.remoteAddr,
localAddr,};console.log(request)returnio.handler()(request,connInfo);};Deno.serve({port: PORT,hostname: HOSTNAME},customIOHandler);
Describe the bug
Deno's std/http/server.ts>serve is deprecated and will be removed in version 1.0.0. Instead they suggest to use Deno.serve.
This library currently does not seem to be compatible with Deno.serve. It throws the following error:
To Reproduce
deps.ts
test.ts
Expected behavior
Ideally I would expect the socketio handler to be compatible with Deno.serve.
Platform:
MacOS 13.5 (Intel-based)
deno 1.35.3 (release, x86_64-apple-darwin)
v8 11.6.189.12
typescript 5.1.6
The text was updated successfully, but these errors were encountered: