-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
What version of Hono are you using?
4.5.1
What runtime/platform is your app running on?
Node.js
What steps can reproduce the bug?
import { Hono } from "hono"
import { UpgradeWebSocket } from "hono/ws"
declare var upgradeWebSocket: UpgradeWebSocket // actually I'm using `@hono/node-ws` one, but `@hono/node-ws` exposing UpgradeWebSocket as-is
const app = new Hono()
app.get("/api/rooms/:roomId/info", async c => {
const roomId: string = c.req.param("roomId")
// @ts-expect-error
const yetAnotherParam: string = c.req.param("yetAnotherParam")
return c.json({"name": "stub"})
})
app.get("/api/rooms/:roomId/ws", upgradeWebSocket(c => {
const roomId: string = c.req.param("roomId")
// @ts-expect-error
const yetAnotherParam: string = c.req.param("yetAnotherParam")
return {}
}))What is the expected behavior?
In the example code, c.req.param("yetAnotherParam") should return string | undefined in both handlers (all of // @ts-expect-error should be consumed).
What do you see instead?
In the example code, c.req.param("yetAnotherParam") returns a string in the handler using UpgradeWebSocket.
Additional information
No response
Reactions are currently unavailable