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

RPC client: Type instantiation is excessively deep and possibly infinite #1921

Open
subhendupsingh opened this issue Jan 8, 2024 · 1 comment
Labels

Comments

@subhendupsingh
Copy link

What version of Hono are you using?

3.11.11

What runtime/platform is your app running on?

Cloudflare Workers

What steps can reproduce the bug?

image

I initialize hono client in my SvelteKit app like this

let tclient: ReturnType<typeof getClient> | null = null;

Where getClient method is:

export const getClient = (headers: Headers, cookies: Cookies) =>{
          const client = hc<AppType>('http://127.0.0.1:8976',{
          headers: clientHeaders
    });
   
    return client;
}

Also, once I call the getClient method anywhere in my application, the intellisense becomes extremely slow, but works fine.

What is the expected behavior?

  1. RPC client's type should be known beforehand so that I can declare it in a global app.d.ts file and pass it int the request.locals to get access in the entire app.
  2. RPC client should not slow down the intellisense

What do you see instead?

No response

Additional information

No response

@yusukebe
Copy link
Member

yusukebe commented Jan 9, 2024

Hi @subhendupsingh

I cannot reproduce that behavior in my environment. If it is possible, I would like you to create a project to reproduce it and share it with us. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants