-
-
Notifications
You must be signed in to change notification settings - Fork 448
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What version of Elysia is running?
├── @elysiajs/[email protected]
├── @elysiajs/[email protected]
├── @types/[email protected]
├── [email protected]
├── [email protected]
└── [email protected]What platform is your computer?
Linux VM
What environment are you using
node v22.20.0
Are you using dynamic mode?
no
What steps can reproduce the bug?
- Create a route that requires a request body
- create an
eden treatyclient - call the route with the client and note that
bodyparams hasanyas type - create an
eden fetchclient - do same -> note that
eden fetchclient has correct type
Visual
// backend api
new Elysia
.post(
"/create-post",
async (ctx) => {
return {
message: "Post Created",
data: ctx.body,
};
},
{
body: t.Object({
name: t.String(),
content: t.String(),
safeAge: t.Number(),
}),
},// client
const clientTreaty = ...
const clientFetch = ...
// eden treaty is bugged
await clientTreaty.['create-post'].post({
// here property names are correct, but every props types is any
})
// eden fetch is correct
await clientFetch('/create-post', {
method: 'POST',
body: {
// here property names and types are correct
}
);What is the expected behavior?
correct types
What do you see instead?
any type for each body param
Additional information
Have you try removing the node_modules and bun.lockb and try again yet?
yes
MaxAltena
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working