vscode_deno icon indicating copy to clipboard operation
vscode_deno copied to clipboard

tRPC or Hono RPC - Can't import types from Deno folder (server) to Node folder (client)

Open ds315 opened this issue 4 months ago • 6 comments

Describe the bug

Can't import types from Deno folder (server) to Node folder (client).

To Reproduce

  1. I made Deno + Hono server, export type of router from server and enable Deno Language Server for whole project (client and server). Types successfully import's in client, but alot of errors appears. server settings client errors

  2. I enable Deno Language Server only for server folder. Types to router disappear's in client folder. settings1 client1

  3. I tried to put import to separate file and enable Deno Language Server to it. It doesn't helps. router settings2 client2

Expected behavior

Is that possible to Deno Language Server can work with Node projects ?

When enable Deno Language Server, it disables VS Codes Language Server. (it's clear)

As I understand, it's like - [Feature Request] Support multiple types of projects in the same repository #488 in Q4 roadmap ?

Versions

vscode: 1.87.0, deno: 1.40.5, extension: 3.33.3

ds315 avatar Mar 06 '24 10:03 ds315

Try removing deno.enablePaths and having a top-level deno.json with the following:

{
  "compilerOptions": {
    "target": "esnext",
    "lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"]
  }
}

nayeemrmn avatar Mar 06 '24 15:03 nayeemrmn

Thank's much ! But now i have a problem:

error

How to solve it ?

ds315 avatar Mar 06 '24 19:03 ds315

Try adding the following to your deno.json and then restarting the language server:

"unstable": ["byonm"]

nayeemrmn avatar Mar 06 '24 20:03 nayeemrmn

Doesn't helps

Situation same as before, - some types are 'any' - Hono<any, any, any> and deno-ts(2344)

I can publish test projects (Hono RPC and tRPC), if it helps

ds315 avatar Mar 07 '24 09:03 ds315

@ds315 You'll have to push to a repo or create a smaller reproduction that I can pull so I can figure out what's wrong.

nayeemrmn avatar Mar 08 '24 01:03 nayeemrmn

I'd published both Hono RPC and tRPC - https://github.com/ds315/trpc and https://github.com/ds315/hono

Both works good, only problem with types in Client in VS Code

ds315 avatar Mar 09 '24 07:03 ds315