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
If the inferred type of the response FormData, then the value should be a FormData instance.
What do you see instead?
The value is not a FormData instance. Seems Elysia unwraps the FormData and provides a value that looks like
{file: File}
but the entire object is typed as FormData, which doesn't match the actual value.
Additional information
When returning { file } from the handler, Elysia infers the type as { file: File } which doesn't match the actual value either. It's just an empty object on the client, {}.
Seems the only way to preserve file data on the client and getting the correct types is by returning FormData from the handler, but forcing the correct type on the client,
constfile=(resasunknownas{file: File}).file;
The text was updated successfully, but these errors were encountered:
What version of Elysia is running?
1.2.9
What platform is your computer?
Linux 6.8.0-50-generic x86_64 x86_64
What steps can reproduce the bug?
From a handler, return
FormData
like so:What is the expected behavior?
If the inferred type of the response
FormData
, then the value should be a FormData instance.What do you see instead?
The value is not a
FormData
instance. Seems Elysia unwraps the FormData and provides a value that looks likebut the entire object is typed as
FormData
, which doesn't match the actual value.Additional information
When returning
{ file }
from the handler, Elysia infers the type as{ file: File }
which doesn't match the actual value either. It's just an empty object on the client,{}
.Seems the only way to preserve file data on the client and getting the correct types is by returning FormData from the handler, but forcing the correct type on the client,
The text was updated successfully, but these errors were encountered: