When using @hono/vite-dev-server with Deno, requests for pre-bundled client dependencies (from .vite/deps/) hit the Hono router instead of being served by Vite, resulting in 404s for all of them.
I have been able to reproduce it here: https://github.com/vhespanha/hono-vite-deno-repro. Run it and you'll see the bundled dep requests (cowsay in this case) hitting the router. This behavior is not present in Node.
I think the root cause is that .vite/deps is not present on the exclude list. But for whatever reason NodeJS doesn't care about that and works anyways.
I have been able to fix it by simply doing:
plugins: [devServer({
entry: "./server.ts",
exclude: [
/^\/.vite\/.+$/,
...defaultOptions.exclude,
],
})],
But I'm also gonna be opening a PR to include the .vite/* directories to the aforementioned exclude list.
When using
@hono/vite-dev-serverwith Deno, requests for pre-bundled client dependencies (from.vite/deps/) hit the Hono router instead of being served by Vite, resulting in 404s for all of them.I have been able to reproduce it here: https://github.com/vhespanha/hono-vite-deno-repro. Run it and you'll see the bundled dep requests (
cowsayin this case) hitting the router. This behavior is not present in Node.I think the root cause is that
.vite/depsis not present on the exclude list. But for whatever reason NodeJS doesn't care about that and works anyways.I have been able to fix it by simply doing:
But I'm also gonna be opening a PR to include the
.vite/*directories to the aforementioned exclude list.