8000 `Polka<Request>.handler` is not assignable to the handler argument of `http.createServer`? · Issue #194 · lukeed/polka · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Polka<Request>.handler is not assignable to the handler argument of http.createServer? #194
Open
@aradalvand

Description

@aradalvand

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:

image

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)

< 3C2D div height="sm" width="random" class="Box-sc-g0xbh4-0 LoadingSkeleton-sc-695d630a-0 hpcToU cShPCj">

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0