Hot reload not working? (BUN)

I try to setup the @hono/vite-dev-server with the default setup vite.config.ts
import { defineConfig } from "vite";
import devServer from "@hono/vite-dev-server";

export default defineConfig({
plugins: [
devServer({
entry: "src/index.tsx", // The file path of your application.
}),
],
});
import { defineConfig } from "vite";
import devServer from "@hono/vite-dev-server";

export default defineConfig({
plugins: [
devServer({
entry: "src/index.tsx", // The file path of your application.
}),
],
});
src/index.tsx
import { Hono } from "hono";

const app = new Hono();

app.get("/", (c) => c.html(<h1>Hello Vite!</h1>));

export default app;
import { Hono } from "hono";

const app = new Hono();

app.get("/", (c) => c.html(<h1>Hello Vite!</h1>));

export default app;
The hot reload is very buggy on my side, it reload one time, and after it never updates the page again. Did I miss something?
5 Replies
Artifex
Artifex6mo ago
Hot reload is just broken in bun, even the --watch flag
lessquo
lessquo6mo ago
Which bun version are you using?
! Gaetan Puleo
! Gaetan PuleoOP6mo ago
I use 1.1.7 It's a bug coming from vite, the plugin or bun?
Artifex
Artifex6mo ago
even not doing the vite config just a plain hono server break things for me
! Gaetan Puleo
! Gaetan PuleoOP6mo ago
I may I found a way to ditch vite. I use this package https://github.com/aabccd021/bun-html-live-reload
export default withHtmlLiveReload({
fetch: app.fetch,
});
export default withHtmlLiveReload({
fetch: app.fetch,
});
And I launch my app with bun --hot src/index.tsx The page is reloading after each save.
GitHub
GitHub - aabccd021/bun-html-live-reload: Automatically reload html ...
Automatically reload html when Bun hot reloads. Contribute to aabccd021/bun-html-live-reload development by creating an account on GitHub.
Want results from more Discord servers?
Add your server