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
I am getting a typescript error for the following code:
Here is the full typescript error:
No overload matches this call.
Overload 1 of 2, '(key: "jwtPayload", value: any): void', gave the following error.
Argument of type '"userId"' is not assignable to parameter of type '"jwtPayload"'.
Overload 2 of 2, '(key: "userId", value: string): void', gave the following error.
Argument of type 'unknown' is not assignable to parameter of type 'string'.
28 c.set("userId", payload.id);
~~~
If I change the key of the set method to "jwtPayload" it works. But this doesn't make any sense to me. It would seem to imply that you can only set one variable named "jwtPayload", which conflicts with the examples given in the documentation.
Sorry if I have misunderstood something obvious, I am new to both Hono and typescript.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am getting a typescript error for the following code:
Here is the full typescript error:
No overload matches this call.
Overload 1 of 2, '(key: "jwtPayload", value: any): void', gave the following error.
Argument of type '"userId"' is not assignable to parameter of type '"jwtPayload"'.
Overload 2 of 2, '(key: "userId", value: string): void', gave the following error.
Argument of type 'unknown' is not assignable to parameter of type 'string'.
28 c.set("userId", payload.id);
~~~
If I change the key of the set method to "jwtPayload" it works. But this doesn't make any sense to me. It would seem to imply that you can only set one variable named "jwtPayload", which conflicts with the examples given in the documentation.
Sorry if I have misunderstood something obvious, I am new to both Hono and typescript.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions