Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not send data when socket is not READY (#128)
Follow up to #113. Even with the above fix, I encountered a similar issue, this time in the `invalid` handler: ``` uncaughtException Error: WebSocket is not open: readyState 2 (CLOSING) at WebSocket.send (/app/node_modules/webpack-plugin-serve/node_modules/ws/lib/websocket.js:322:19) at WebpackPluginServe.socket.invalid (/app/node_modules/webpack-plugin-serve/lib/routes.js:83:16) at WebpackPluginServe.emit (events.js:189:13) at invalid.tap (/app/node_modules/webpack-plugin-serve/lib/index.js:155:41) at SyncHook.eval (eval at create (/app/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1) at Watchpack.watcher.compiler.watchFileSystem.watch (/app/node_modules/webpack/lib/Watching.js:139:33) at Object.onceWrapper (events.js:277:13) at Watchpack.emit (events.js:189:13) at Watchpack._onChange (/app/node_modules/watchpack/lib/watchpack.js:118:7) at Watchpack.<anonymous> (/app/node_modules/watchpack/lib/watchpack.js:99:8) at Watcher.emit (events.js:189:13) at /app/node_modules/watchpack/lib/DirectoryWatcher.js:109:7 at Array.forEach (<anonymous>) at DirectoryWatcher.setFileTime (/app/node_modules/watchpack/lib/DirectoryWatcher.js:108:41) at DirectoryWatcher.onChange (/app/node_modules/watchpack/lib/DirectoryWatcher.js:264:7) at FSWatcher.emit (events.js:189:13) at FSWatcher.<anonymous> (/app/node_modules/watchpack/node_modules/chokidar/index.js:199:15) at /app/node_modules/watchpack/node_modules/chokidar/index.js:238:7 at FSReqWrap.oncomplete (fs.js:155:5) ``` As suggested in #113 (comment) I've wrapped `send` so the error should not come back anymore.
- Loading branch information