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
The HTTPS example shows app.handler being passed to https.createServer as the request handler, and this does work, but you get type errors when you do it, which leads me to believe there must be something wrong with Polka's types here:
This is the case for all three of http, https, and http2.
The error for http.createServer reads:
Argument of type 'Middleware' is not assignable to parameter of type 'RequestListener<typeof IncomingMessage, typeof ServerResponse>'.
Target signature provides too few arguments. Expected 3 or more, but got 2.ts(2345)
For https.createServer:
Argument of type 'Middleware' is not assignable to parameter of type 'RequestListener<typeof IncomingMessage, typeof ServerResponse>'.ts(2345)
And http2.createSecureServer:
Argument of type 'Middleware' is not assignable to parameter of type '(request: Http2ServerRequest, response: Http2ServerResponse) => void'.
Target signature provides too few arguments. Expected 3 or more, but got 2.ts(2345)
The text was updated successfully, but these errors were encountered:
The HTTPS example shows
app.handler
being passed tohttps.createServer
as the request handler, and this does work, but you get type errors when you do it, which leads me to believe there must be something wrong with Polka's types here:This is the case for all three of
http
,https
, andhttp2
.The error for
http.createServer
reads:For
https.createServer
:And
http2.createSecureServer
:The text was updated successfully, but these errors were encountered: