Skip to content
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

Server returning 500 error when using nested body for post request, but works fine when using primitive body. #434

Closed
surething171 opened this issue Jan 22, 2024 · 1 comment

Comments

@surething171
Copy link

image
import { Elysia, t } from 'elysia'; const app = new Elysia() .post('/some', ({ body }) => 'one', { body: t.Object({ name: t.String(), }), })

When I try to access the above route, it returns error with 500 code, and in the command line of the server, it doesn't show anything. And in the response it is showing empty curly bracket {}.

image
When using primitive types for the body, it is working as expected.
I tried to find the issue in the github issues, there is this closed issue #148.

@surething171
Copy link
Author

Ok, so I installed some other packages, and interestingly now it is working as expected. I didn't make any change in the code. So I am closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant