eventsource
eventsource copied to clipboard
TypeError: SseStream is not a constructor
When I use example to run the program, I will be prompted TypeError: SseStream is not a constructor at D:\serialport\eventsource-master\example\sse-server.js:10:20 at Layer.handle [as handle_request] (D:\serialport\eventsource-master\node_modules\express\lib\router\layer.js:95:5) at next (D:\serialport\eventsource-master\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (D:\serialport\eventsource-master\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (D:\serialport\eventsource-master\node_modules\express\lib\router\layer.js:95:5) at D:\serialport\eventsource-master\node_modules\express\lib\router\index.js:281:22 at Function.process_params (D:\serialport\eventsource-master\node_modules\express\lib\router\index.js:335:12) at next (D:\serialport\eventsource-master\node_modules\express\lib\router\index.js:275:10) at SendStream.error (D:\serialport\eventsource-master\node_modules\serve-static\index.js:121:7) at SendStream.emit (events.js:315:20) How to solve it?
Same situation, could you solve this problem?
Please, use:
const SseStream = require('ssestream').default;