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
Argument of type string is not assignable to parameter of type { 200: string; }.
Additional information
Essentially, when response validates the type T, the type checking of data argument requires {200: T}. However, the execution expects T: if provided with a {200: T}, a validation error is thrown.
I believe a previous version had the correct type for the data argument: WS['data']['schema']['response'] instead of Route["response"].
Have you try removing the node_modules and bun.lockb and try again yet?
No.
The text was updated successfully, but these errors were encountered:
What version of Elysia is running?
1.1.12
What platform is your computer?
Darwin 24.1.0 arm64 arm
What steps can reproduce the bug?
In an
Elysia.ws
handler, add aresponse
validator and usews.publish
, like this:What is the expected behavior?
There should be no type error.
What do you see instead?
"hello"
has a type error:Additional information
Essentially, when
response
validates the typeT
, the type checking ofdata
argument requires{200: T}
. However, the execution expectsT
: if provided with a{200: T}
, a validation error is thrown.I believe a previous version had the correct type for the
data
argument:WS['data']['schema']['response']
instead ofRoute["response"]
.Have you try removing the
node_modules
andbun.lockb
and try again yet?No.
The text was updated successfully, but these errors were encountered: