Error cannot file module "@hono/bun" (TS2307)
I'm trying to statically serve some files, in the docs it says to use serveStatic from @hono/bun, but I receive the error modules and its types not found.
I've tried multiple solutions but none work:
- Tried installing the packaged to ensure @hono/bun was installed using bun add @hono/bun (but it doesnt even exist)
- Checked TypeScript types if type declarations existed. Tried adding declare module "@hono/bun"; to global.d.ts to bypass missing types but server doesn't run.
- Confirmed Bun version which I'm with the latest version.
- Reinstalled dependencies deleting node_modules and bun.lockb, then reinstalling dependencies with bun install, but the error persists.
How to solve this?
3 Replies
you have to use hono/bun
not @hono/bun
from the docs
Thanks, that was the problem 🙏
Happy to help