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

Issue with TypeScript Path Alias in eden Treaty Mapping #99

Open
Jojit-Thomas opened this issue May 27, 2024 · 2 comments
Open

Issue with TypeScript Path Alias in eden Treaty Mapping #99

Jojit-Thomas opened this issue May 27, 2024 · 2 comments

Comments

@Jojit-Thomas
Copy link

The eden treaty fails to map the API correctly when using TypeScript path aliases. It only works with relative paths.

Steps to Reproduce
Set up a TypeScript project with path aliases configured in tsconfig.json.
Attempt to use a path alias in the eden treaty configuration. For example, use @/authRouter instead of ./authRouter.

// This works
import authRouter from './authRouter';

// This doesn't work
import authRouter from '@/authRouter';

Environment
eden version: 1.0.11
TypeScript version: 5.4.5
Bun version: 1.1.10
OS: Mac OS

@abielzulio
Copy link

Facing the same issue here

@Ripwords
Copy link

Ripwords commented Jul 6, 2024

Here's the fix, #110 (comment)

You just need your frontend's tsconfig to reference the backend's tsconfig

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

3 participants