Realtime (at Eventsource), how to fix console errors?

Realtime project (on Eventsource) written by React + node (the data on the graph is updated every 10 minutes). Everything works, only errors appear in the console ( Can anyone tell me how to remove these errors?


router.get('/connect', (req, res) => {
res.writeHead(200, {
    Connection: 'keep-alive',
    'Content-Type': 'text/event-stream',
    'Cache-Control': 'no-cache',
emitter.on('dataChart', (message) => {
    res.write(`data: ${JSON.stringify(message)} \n\n`)



    useEffect(() => {

     const eventSource = new EventSource('http://localhost:5000/api/gsm/connect')
     eventSource.onmessage = function (event) {

}, [])

viewing a picture with errors

Read more here:

Content Attribution

This content was originally published by dragon at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: