Replies: 2 comments 1 reply
-
@hill try adding @types/bun to your devDependencies on the client, this fixed it for me after @SaltyAom suggested it |
Beta Was this translation helpful? Give feedback.
0 replies
-
I also have this issue and adding @types/bun did not solve the problem. for performance reason, I compile the app types into index.d.ts and import it in my frontend. when using streams, data is of type any. but my compiled types I see that response 200 is of type AsyncGenerator, see images. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm very new to Elysia and am trying to understand its capabilities.
When reading this doc about the Eden treaty response, I understand that the type of the
data
field should be typed - as suggested in the code snippet on that page:However when I try to do this with a monorepo setup (A client package and server package, with the tsconfig.json in client referencing the server directory), the typehint has
data
asany
:I noticed in the overview docs, that the post data response (
nendoroid
) is typed asany
on hover:Is it intended that the
post()
method does not havedata
type inferred from the server response?Sorry If I missed documentation outlining this - would love to be pointed to it.
For reference my server code looks like:
and my treaty:
My client call is:
In client dependencies,
"@elysiajs/eden": "^1.1.3",
and on server dependencies:
"elysia": "^1.1.3"
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions