You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is not an issue in bun. you cannot use connect middleware directly with Bun.serve. you should use express or polka or fastify with @fastify/middie
it's by @nitedani. Here's my current code with working Bun + Vite HMR + Custom Websocket handler + Watching of backend changes (like in controllers).
Only caveats I noticed (reproducible in the above example):
bun run --watch server.ts will cause an infinite loop when Vite.createServer is called (Basically same problem as this Include/exclude config for bun run --watch #5278 (comment)). So I'm using nodemon because it can exclude watching of other files).
In incognito HMR will break. Something about Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
HMR + Custom Websocket Handler works. BUT watching backend changes is scuffed because it will "lose connection" to the server and reconnect again. (losing frontend state)
What is the problem this feature would solve?
Since
Bun.serve
doesn't havehttp.Incoming
andhttp.ServerResponse
, I'm wondering how to implement an equivalent of this Node code in Bun.In Node:
What is the feature you are proposing to solve the problem?
Maybe an adapter for Bun.serve with
http.Incoming
andhttp.ServerResponse
if it's possible?What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: