You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
This discussion was converted from issue #21123 on November 16, 2025 03:23.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I am trying to use rpc with hono. The following is my folder structure.
.
├── bun.lock
├── frontend
│ ├── bun.lock
│ ├── components.json
│ ├── dist
│ │ ├── assets
│ │ │ ├── index-Bbk2uyJO.js
│ │ │ └── index-C1mO6vrr.css
│ │ ├── index.html
│ │ └── vite.svg
│ ├── eslint.config.js
│ ├── index.html
│ ├── package.json
│ ├── public
│ │ └── vite.svg
│ ├── README.md
│ ├── src
│ │ ├── App.css
│ │ ├── App.tsx
│ │ ├── assets
│ │ │ └── react.svg
│ │ ├── components
│ │ │ └── ui
│ │ │ ├── button.tsx
│ │ │ └── card.tsx
│ │ ├── lib
│ │ │ ├── api.ts
│ │ │ └── utils.ts
│ │ └── main.tsx
│ ├── tsconfig.app.json
│ ├── tsconfig.json
│ ├── tsconfig.node.json
│ └── vite.config.ts
├── package.json
├── README.md
├── server
│ ├── app.ts
│ ├── index.ts
│ └── routes
│ └── expenses.ts
└── tsconfig.json
The app was working fine until, I tried to use rpc and import the hono client. then I got the following in my terminal
9:02:33 AM [vite] Internal server error: Failed to resolve import "@server/app" from "src/lib/api.ts". Does the file exist?
Plugin: vite:import-analysis
File: /home/shojib116/code/hono-practice/frontend/src/lib/api.ts:1:29
1 | import "@server/app";
| ^
2 | import { hc } from "hono/client";
3 | const client = hc("/");
at _formatLog (/home/shojib116/code/hono-practice/frontend/node_modules/vite/dist/node/chunks/node.js:30669:43)
at error (/home/shojib116/code/hono-practice/frontend/node_modules/vite/dist/node/chunks/node.js:30666:14)
at processTicksAndRejections (native)
9:02:33 AM [vite] (client) Pre-transform error: Failed to resolve import "@server/app" from "src/lib/api.ts". Does the file exist?
Plugin: vite:import-analysis
File: /home/shojib116/code/hono-practice/frontend/src/lib/api.ts:1:29
1 | import "@server/app";
| ^
2 | import { hc } from "hono/client";
3 | const client = hc("/");
this is part of my tsconfig.json
"compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./src/*"], "@server/*": ["../server/*"], } }this is part of my vite.config.ts
resolve: { alias: { "@": path.resolve(import.meta.dirname, "./src"), "@server": path.resolve(import.meta.dirname, "./server"), }, },Reproduction
https://github.com/shojib116/hono-expense-tracker
Steps to reproduce
No response
System Info
System: OS: Linux 6.8 Linux Mint 22.1 (Xia) CPU: (16) x64 12th Gen Intel(R) Core(TM) i5-1240P Memory: 5.50 GB / 15.36 GB Container: Yes Shell: 5.9 - /usr/bin/zsh Binaries: Node: 22.17.0 - /home/shojib116/.nvm/versions/node/v22.17.0/bin/node npm: 11.6.0 - /home/shojib116/.nvm/versions/node/v22.17.0/bin/npm pnpm: 10.18.3 - /home/shojib116/.local/share/pnpm/pnpm bun: 1.2.20 - /home/shojib116/.bun/bin/bun Deno: 2.4.3 - /home/shojib116/.deno/bin/deno Browsers: Brave Browser: 142.1.84.139 Firefox: 145.0 Firefox Developer Edition: 145.0 npmPackages: @vitejs/plugin-react: ^5.1.0 => 5.1.0 rolldown-vite: 7.2.2Used Package Manager
bun
Logs
Click to expand!
Validations
Beta Was this translation helpful? Give feedback.
All reactions