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

Using typescript path aliases, eg. @app on the server break eden treaty typing. #110

Closed
IOnlyNeedParenthesis opened this issue Jul 5, 2024 · 2 comments

Comments

@IOnlyNeedParenthesis
Copy link

Hello,
I have been developing on a monorepo with elysia.
When using the eden treaty, route parameters are type hinted as any instead of the expected types.
We have narrowed it down to being a path aliasing issue.

See this repository for a reproduction https://github.com/IOnlyNeedParenthesis/elysia-eden-treaty-repro.
This seems to be the same issue as in #99 and possibly related to #42.

@Ripwords
Copy link

Ripwords commented Jul 6, 2024

I'm not sure if it's necessarily an Elysia/Eden issue. The workaround is just to simply update your frontend's tsconfig.json to reference your backend tsconfig.json

Frontend

"references": [
    {
      "path": "../backend"             // Add reference to the backend tsconfig
    }
  ]

Backend

 "compilerOptions": {
    "composite": true,                 // Enable this line
}

Here's my working template if anyone needs to refer
https://github.com/Ripwords/elysia-lucia-template

@IOnlyNeedParenthesis
Copy link
Author

Hey @Ripwords, your solution solves the issue.
Thanks a lot.

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

2 participants