We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.1.20 - 1.1.26
Microsoft Windows NT 10.0.22631.0 x64
Create an Elysia route with response validation:
new Elysia().post('', async () => { // ... }, { response: { 200: t.UnionEnum(['user has joined already', 'added free plan']), 401: t.String(), }, body: t.Object({ agreedOnDataTerms: t.Boolean(), }), })
Then create an eden treaty client for this route.
treaty<Route>(getBaseUrl()).index.post
This is the correct type output for versions 1.1.20 and below.
This is the type output for versions 1.1.21 through 1.1.26
Only the response is inferred incorrectly.
I am using Elysia for Route Handlers in NextJS 15. Eden Treaty version is 1.1.3
node_modules
bun.lockb
Yes, multiple times, tried different Elysia versions as well.
The text was updated successfully, but these errors were encountered:
Same experience here, I use it with expo-router on an expo app.
Eden version "@elysiajs/eden": "1.1.3",, anything bigger than "elysia": "1.1.20", breaks types for async handlers.
"@elysiajs/eden": "1.1.3",
"elysia": "1.1.20",
async
Reproduction is simple, just slam an async on any route, types stop working, here is an example:
import { Elysia, t } from "elysia"; export const pokemons = new Elysia({ prefix: "/pokemons" }).get( "/", async () => { const pokemons = await fetch( "https://pokeapi.co/api/v2/pokemon/?limit=20&offset=20", ); const response = (await pokemons.json()) as { results: { name: string; url: string }[]; }; return { success: true, message: response.results }; }, { response: t.Object({ success: t.Boolean(), message: t.Array( t.Object({ name: t.String(), url: t.String(), }), ), }), }, );
This works well on elysiajs 1.1.20 and treaty 1.1.3
1.1.20
1.1.3
Sorry, something went wrong.
Did you install @types/bun into project that want to use treaty ? @lunarW1TCH @jvidalv
@types/bun
treaty
I did not, I am using bun only as a dependency manager. Adding bun types breaks the app in multiple places.
No branches or pull requests
What version of Elysia is running?
1.1.20 - 1.1.26
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What steps can reproduce the bug?
Create an Elysia route with response validation:
Then create an eden treaty client for this route.
What is the expected behavior?
This is the correct type output for versions 1.1.20 and below.
What do you see instead?
This is the type output for versions 1.1.21 through 1.1.26
Only the response is inferred incorrectly.
Additional information
I am using Elysia for Route Handlers in NextJS 15. Eden Treaty version is 1.1.3
Have you try removing the
node_modules
andbun.lockb
and try again yet?Yes, multiple times, tried different Elysia versions as well.
The text was updated successfully, but these errors were encountered: