question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

in your sse-server.js line9 setTimeout is not very fit here, I suggest you shold use setInterval

your old code

  setTimeout(() => {
    const secondData = { name: "Laetitia" };

    res.write(`data: ${JSON.stringify(secondData)}`);
    res.write("\n\n");
  }, 500);

i suggest

  setInterval(() => {
    const secondData = { name: "Laetitia" };

    res.write(`data: ${JSON.stringify(secondData)}`);
    res.write("\n\n");
  }, 500);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ZhengXingchicommented, Jul 15, 2020

sorry to see your answer so late。i will make a PR tomorrow to fix this if that is convenient。😃

0reactions
ZhengXingchicommented, Jul 16, 2020

the travis Ci failed to run because you take a minor mistake.you should update your config in order to run perfectly.

{
  "language": "node_js",
  "os": [
    "linux"
  ],
  "dist": "xenial",
  "node_js": [
    "10"
  ],
  "addons": {
    "apt": {
      "packages": [
        "libgconf-2-4"
      ]
    }
  },
  "cache": {
    "npm": true,
    "directories": [
      "~/.cache"
    ]
  },
  "before_script": [
    "yarn check:lint"
  ],
  "script": [
    "npm run build",
    "npm start",
    "npm run start:test-server",
    "npm run e2e:ci",
    "kill $(jobs -p) || true"
  ]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

SSE Defects · Issue #23997 · quarkusio/quarkus - GitHub
Describe the bug Multiple issues related to Server Sent Events demonstrated in ... See sse-server-reactive TimeBroadcaster .
Read more >
1251117 - EventSource (Server Sent Event) doesn't retry after ...
Attached file sse-test.js -- simple node.js SSE server — Details ... This bug makes Firefox unsuitable for the use of EventSource .
Read more >
Server-sent events: a simple way to stream events from a server
I'm going to talk about what they're for, how they work, and a couple of bugs I ran into while using them yesterday....
Read more >
Issue Tracking - Gatling
GitHub's Bug Tracker and Google Group. ... A bug tracker is meant for reporting bugs and asking for features. For asking questions, please...
Read more >
Angular 8 - handling SSE reconnect on error - Stack Overflow
... to replace polling with SSE (Server-sent events) or Web Sockets. ... The only thing that bugs me is correct way to reconnect...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found