express-sse
express-sse copied to clipboard
Flush not a function error using node-js version 14.15.x
With the current LTS node-js version i get the error measure uncaughtException: res.flush is not a function\nTypeError: res.flush is not a function\n at SSE.dataListener ...
Same problem at: node -v : v14.9.0 npm -v : 6.14.8 "express": "4.17.1" "express-sse": "0.5.3"
possible solutions:
- revert to "express-sse": "0.5.1"
- add "compression": "1.7.4" to the dependencies * after "const app = express();" also add "app.use( compression() );" * I guess internally this will work similar to https://github.com/expressjs/compression#server-sent-events
I would appreciate a fix.
Also problematic for v16.6.1
Feel free to install my fork instead as it has this fix.
npm i github:omgimalexis/express-sse
https://github.com/OmgImAlexis/express-sse
Feel free to install my fork instead as it has this fix.
Thank you! When I tried yours with const sse = new SSE();
error: SSE is not a constructor.
I had to use const SSE = require('express-sse').SSE;
instead and then it worked. Just FYI for others.