Skip to content

fix: do not send data when socket is not READY#128

Merged
shellscape merged 1 commit intoshellscape:masterfrom
niieani:patch-2
May 1, 2019
Merged

fix: do not send data when socket is not READY#128
shellscape merged 1 commit intoshellscape:masterfrom
niieani:patch-2

Conversation

@niieani
Copy link
Contributor

@niieani niieani commented Apr 29, 2019

This PR contains:

  • bugfix
  • feature
  • refactor
  • tests
  • documentation
  • metadata

Breaking Changes?

  • yes
  • no

If yes, please describe the breakage.

Please Describe Your Changes

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.

@matheus1lva matheus1lva requested a review from shellscape April 29, 2019 15:57
@shellscape
Copy link
Owner

@niieani as always, thank you for pitching in on the project. please rebase to master and you'll get the changes to fix what is blocking CI.

Follow up to shellscape#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 shellscape#113 (comment) I've wrapped `send` so the error should not come back anymore.
@niieani
Copy link
Contributor Author

niieani commented May 1, 2019

@shellscape rebased!

@shellscape shellscape merged commit 3327580 into shellscape:master May 1, 2019
@shellscape
Copy link
Owner

merged! thank you! I'll release this as soon as I have a chance to look at #131

smashercosmo pushed a commit to smashercosmo/webpack-plugin-serve that referenced this pull request Jul 23, 2019
Follow up to shellscape#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 shellscape#113 (comment) I've wrapped `send` so the error should not come back anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants