Environment
h3: 2.0.1-rc.5
Reproduction
https://h3.dev/guide/advanced/websocket
Describe the bug
Here is the app.fetch's type
|
fetch(_request: ServerRequest): Response | Promise<Response>; |
fetch(_request: ServerRequest): Response | Promise<Response>;
But when we use defineWebsocketHandler, the function returns crossws as an extra result
https://github.com/h3js/h3/blob/d6475e131b3a80f44bebd5b95ce3e106ed1ac258/src/utils/ws.ts#L23C1-L41C2
/**
* Define WebSocket event handler.
*
* @see https://h3.dev/guide/websocket
*/
export function defineWebSocketHandler(
hooks: Partial<WebSocketHooks>,
): EventHandler {
return defineHandler(function _webSocketHandler() {
return Object.assign(
new Response("WebSocket upgrade is required.", {
status: 426,
}),
{
crossws: hooks,
},
);
});
}
Environment
h3: 2.0.1-rc.5
Reproduction
https://h3.dev/guide/advanced/websocket
Describe the bug
Here is the
app.fetch's typeh3/src/types/h3.ts
Line 106 in d6475e1
But when we use
defineWebsocketHandler, the function returnscrosswsas an extra resulthttps://github.com/h3js/h3/blob/d6475e131b3a80f44bebd5b95ce3e106ed1ac258/src/utils/ws.ts#L23C1-L41C2