unjs / h3

⚡️ Minimal H(TTP) framework built for high performance and portability

Home Page:https://h3.unjs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Event stream "onClosed" callback not firing on Nuxt

brunohstein opened this issue · comments

Environment

  • h3 nightly
  • Nuxt 3.11.1
  • Node 18.18.0

Reproduction

I expected the server to log the message on eventStream.onClosed callback but that didn't happen.

Captura de Tela 2024-03-21 às 09 04 36

I also expected it to log on node.req "close" event as well, so I'm confused if I'm getting something really wrong. (About this I found this post that reports a similar problem)

https://stackblitz.com/edit/nuxt-starter-aa9nxb?file=pages%2Findex.vue

Describe the bug

Hi! I'm experimenting with the new SSE support and having some trouble to close listeners and connections when the SSE request connection is closed. If I'm not missing something, it looks like onClosed should be fired but it's not.

Additional context

No response

Logs

No response

Probably related: unjs/nitro#1515.

Should this issue be handled in unjs/nitro or even nuxt/nuxt?