h3 icon indicating copy to clipboard operation
h3 copied to clipboard

Bun adapter cannot load webpage unless cache is disabled

Open cysabi opened this issue 1 year ago • 2 comments

environment

"h3": "^1.11.1", "vite": "^5.2.11", "typescript": "^5.0.0" bun v1.1.13

reproduction

combine bun, vite (dev server middleware mode), and h3. attempt to serve the vite dev server through h3 with the bun adapter go to localhost on your browser, now try disabling cache in the network tab

describe the bug

the webpage will stall on "waiting for localhost" indefinitely. turning off cache makes the webpage load near instantly. my domain knowledge in http is not very good, but i presume it has something to do with the cache headers not being passed to bun.serve properly?

additional context

this only happens with the bun adapter, using the node adapter on the bun runtime works completely fine

logs

cysabi avatar Jun 18 '24 23:06 cysabi

Can you please make a reproduction? 🙏🏼

pi0 avatar Jun 19 '24 00:06 pi0

no problem !!

https://github.com/cysabi/bento/tree/h3-issues-779

  1. run bun ./index.ts
  2. open up the dev server, it should work on first load, because there's no cache. then subsequent reloads fail.
  3. open the network tab and disable cache, then try reloading :)

thanks for you hard work ❤️

cysabi avatar Jun 22 '24 02:06 cysabi

https://github.com/h3js/h3/pull/1028#issuecomment-2935516547

pi0 avatar Jun 03 '25 14:06 pi0