-
Notifications
You must be signed in to change notification settings - Fork 54
Description
// appModule = await server.ssrLoadModule(entry)
appModule = await server.environments.ssr.runner.import(entry);The main issue is that ssrLoadModule causes hot updates to fail.
Since Hono runs in a Node.js environment, deep submodule imports cannot be collected by Vite's moduleGraph, leading to hot updates not taking effect. (This is my guess, but the problem genuinely exists).
We could consider replacing it with the environment API: https://vite.dev/guide/api-environment-frameworks.html#environments-and-frameworks
I've tested this with Vite 7, and it works, even though the entire Hono application is re-run. However, that's still better than hot updates not working at all.
Hono does not update when duplicate routes are registered; instead, it ignores them. This prevents the use of import.meta.hot.accept for fine-grained HMR. related: honojs/hono#4147, honojs/hono#3817