Open sylvain101010 opened 6 years ago
I just had this very same issue. You must ensure to call reply.sse()
(with no arguments) before closing your server. This works for me
fastify.addHook('onClose', (instance, done) => {
instance._Reply.sse()
done()
})
try adding that hook, then running your server and stop it with Ctrl + c
He is talking about when clients disconnect, that's the same problem I have, NOT when server close...
Hi, When a client disconnect, the server crash with the following error:
here is a stacktrace
How to reproduce:
just run example.js
node example.js
thencurl localhost:3000/sse2
And quit the running curl jobCtrl+c