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

Hono does not seem to work correctly with Vue #3212

Closed
buzzy opened this issue Jul 29, 2024 · 2 comments
Closed

Hono does not seem to work correctly with Vue #3212

buzzy opened this issue Jul 29, 2024 · 2 comments
Labels

Comments

@buzzy
Copy link

buzzy commented Jul 29, 2024

What version of Hono are you using?

4.5.3

What runtime/platform is your app running on?

Bun

What steps can reproduce the bug?

Pull this repo: https://github.com/buzzy/hono-vue

Look in the file /src/api/server.ts
It's a very simple example that uses hono and zod-validator
image

Look in the file /src/api/client.ts
image

As you can see in the picture, all the types get imported correctly.

Now open file /src/views/HomeView.vue
This is a Vue component file.
image

Using the exact same imports as in the server.ts, all types are working except for the input type. It's blank.

What is the expected behavior?

That all the types are imported, including the "input" attribute.

What do you see instead?

When using Hono RPC in a Vue component, the "input" is always blank.

Additional information

No response

@buzzy buzzy added the triage label Jul 29, 2024
@yusukebe
Copy link
Member

yusukebe commented Aug 5, 2024

Hi @buzzy

Add a strict: true in your tsconfig.json:

diff --git a/tsconfig.json b/tsconfig.json
index 66b5e57..5c6a83b 100644
--- a/tsconfig.json
    b/tsconfig.json
@@ -1,5  1,8 @@
 {
   "files": [],
   "compilerOptions": {
     "strict": true
   },
   "references": [
     {
       "path": "./tsconfig.node.json"
@@ -8,4  11,4 @@
       "path": "./tsconfig.app.json"
     }
   ]
-}
 }

@yusukebe yusukebe added not bug and removed triage labels Aug 5, 2024
@yusukebe
Copy link
Member

I'll close this issue. If you need any help related to Hono, please reopen. Anyway, this issue is caused by TypeScript settings.

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