-
-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set method not working when passing a key and value #2484
Comments
Hi @hariyebk It's not a bug. Try to pass the generics to type Variables = {
message: string
}
const app = new Hono<{
Variables: Variables
}>() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of Hono are you using?
4.2.1
What runtime/platform is your app running on?
bun
What steps can reproduce the bug?
app.use(async (c, next) => { c.set('message', 'Hono is cool!!') await next() }) app.get("/", (c) => { const message = c.get("message") return c.text(
${message}) })
What is the expected behavior?
It must work fine when passing the key "message" and the value "honor is cool!"
What do you see instead?
underneath the key, I encountered an error: "No overload matches this call.
Overload 1 of 2, '(key: never, value: never): void', gave the following error".
Additional information
No response
The text was updated successfully, but these errors were encountered: