H
Hono2mo ago
Aleed.dev

react ssr with bun vite and hono

I'm having trouble with @hono/vite-dev-server. The Vite instance isn't being set in Hono's context. My vite.config.ts:
export default defineConfig({
plugins: [
react(),
devServer({ entry: "server.ts" }),
],
});
export default defineConfig({
plugins: [
react(),
devServer({ entry: "server.ts" }),
],
});
In server.ts:
app.use("*", async (c) => {
const vite = c.get("vite"); // This is undefined!
// ...
});
app.use("*", async (c) => {
const vite = c.get("vite"); // This is undefined!
// ...
});
Any idea what I'm missing? link to github url : https://github.com/alidauda/ssr-hono
GitHub
GitHub - alidauda/ssr-hono
Contribute to alidauda/ssr-hono development by creating an account on GitHub.
1 Reply
ambergristle
ambergristle2mo ago
Uh. Why do you expect Vite to set something in Context? This isn’t consistent with any of the documentation I’ve seen What are you trying to accomplish?

Did you find this page helpful?