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
Server sent event messages are delimited by \n\n. So if you send a message that is only a single newline the client will see data:\n\n\n and think that the message has ended after the second \n.
If you want to deliver a message that consists of only '\n' then you will probably need to escape it or wrap it in quotes.
Environment
node 20.12.1
nitropack 2.9.6
Reproduction
// server side
const eventStream = createEventStream(event)
eventStream.push('\n')
// client side
const sse = new EventSource('path/to/sse')
sse.addEventListener('message', e => {
console.log(e.data'')
})
Describe the bug
hope to deliver
'\n'
to client side, but get''
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: