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

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

Open
ds315 opened this issue Mar 6, 2024 · 6 comments
Assignees

Comments

@ds315
Copy link

ds315 commented Mar 6, 2024

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

@nayeemrmn nayeemrmn self-assigned this Mar 6, 2024
@nayeemrmn
Copy link
Collaborator

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"]
  }
}

@ds315
Copy link
Author

ds315 commented Mar 6, 2024

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

error

How to solve it ?

@nayeemrmn
Copy link
Collaborator

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

"unstable": ["byonm"]

@ds315
Copy link
Author

ds315 commented Mar 7, 2024

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

@nayeemrmn
Copy link
Collaborator

@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.

@ds315
Copy link
Author

ds315 commented Mar 9, 2024

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

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

No branches or pull requests

2 participants