-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What version of Elysia is running?
1.2.25
What version of Node Adapter are you using?
20.12.2
What platform is your computer?
MacOS x86_64
What steps can reproduce the bug?
Create an Elysia instance that handle post request
export const signInRoute = new Elysia().post(
'/sign-in',
({ body }) => {
return body
},
{
body: t.Object({
phoneNumber: t.Nullable(t.String()),
email: t.Nullable(t.String()),
password: t.String(),
}),
},
)
Send request in postman with wrong JSON format
What is the expected behavior?
Response a 400 bad request
What do you see instead?
Backend down:
With console:
Server is running on port 3030
undefined:3
"email": null,
^
SyntaxError: Expected ',' or '}' after property value in JSON at position 31
at JSON.parse (<anonymous>)
at IncomingMessage.eval (eval at composeHandler (/Users/linbin/WebstormProjects/badminton-rank-backend/node_modules/elysia/dist/cjs/compose.js:1231:12), <anonymous>:27:14)
at IncomingMessage.emit (node:events:518:28)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Node.js v20.12.2
Additional information
No response
Have you try removing the node_modules and bun.lockb and try again yet?
Yes but not works
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

