There always be An error occurred in development, when parcel reload-hot and stop the service and report
WebSocket is not open: readyState 2 (CLOSING)

{
"presets": ["@babel/preset-env", "@babel/preset-react"],
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
],
["@babel/plugin-syntax-object-rest-spread"],
[
"@babel/plugin-transform-runtime",
{
// "polyfill": false,
"regenerator": true
}
],
[
"import", {
"libraryName": "antd-mobile",
"style": false
}
]
]
}
WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (D:\project\oa-process-mobile\node_modules\ws\lib\websocket.js:314:19)
at HMRServer.broadcast (D:\project\oa-process-mobile\node_modules\parcel-bundler\src\HMRServer.js:110:10)
at HMRServer.emitUpdate (D:\project\oa-process-mobile\node_modules\parcel-bundler\src\HMRServer.js:80:12)
at Bundler.bundle (D:\project\oa-process-mobile\node_modules\parcel-bundler\src\Bundler.js:319:18)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:13364) UnhandledPromiseRejectionWarning: Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (D:\project\oa-process-mobile\node_modules\ws\lib\websocket.js:314:19)
at HMRServer.broadcast (D:\project\oa-process-mobile\node_modules\parcel-bundler\src\HMRServer.js:110:10)
at HMRServer.emitError (D:\project\oa-process-mobile\node_modules\parcel-bundler\src\HMRServer.js:63:10)
at Bundler.bundle (D:\project\oa-process-mobile\node_modules\parcel-bundler\src\Bundler.js:350:18)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:13364) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.7 |
| Node | 10.15.3 |
| npm/Yarn | 6.4.1 |
| Operating System | windows |
I'm also getting _nearly_ the same thing. My terminal output is as follows
馃毃 WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/Users/benjamin/Documents/Git/website/node_modules/parcel-bundler/node_modules/ws/lib/websocket.js:314:19)
at HMRServer.broadcast (/Users/benjamin/Documents/Git/website/node_modules/parcel-bundler/src/HMRServer.js:110:10)
at HMRServer.emitUpdate (/Users/benjamin/Documents/Git/website/node_modules/parcel-bundler/src/HMRServer.js:80:12)
at Bundler.bundle (/Users/benjamin/Documents/Git/website/node_modules/parcel-bundler/src/Bundler.js:319:18)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:56398) UnhandledPromiseRejectionWarning: Error: WebSocket is not open: readyState 2 (CLOSING)
at WebSocket.send (/Users/benjamin/Documents/Git/website/node_modules/parcel-bundler/node_modules/ws/lib/websocket.js:314:19)
at HMRServer.broadcast (/Users/benjamin/Documents/Git/website/node_modules/parcel-bundler/src/HMRServer.js:110:10)
at HMRServer.emitError (/Users/benjamin/Documents/Git/website/node_modules/parcel-bundler/src/HMRServer.js:63:10)
at Bundler.bundle (/Users/benjamin/Documents/Git/website/node_modules/parcel-bundler/src/Bundler.js:350:18)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:56398) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:56398) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code
| Software | Version(s) |
| ---------------- | ---------- |
| parcel-bundler | v1.12.3
| Node | v9.11.2
|Yarn | v1.15.2
| Operating System | macOS Mojave
Willing to open seperate bug report if desired?
Also receiving same errors shown above.
I find that it occurs most frequently when I am making a lot of continuous changes to the project. In most cases I need to restart the project all together however every once and a while I am able to resolve it by re-saving a file in my project.
Not sure what's causing it but i'm curious if changing HMR port from its default will have any positive effect....
I have started getting this error now with Node 12, the latest version of parcel-bundler v1, and Windows.
Not sure what's changed as I haven't experienced it in the past few weeks.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
This issue occurs regularly but nondeterministically and forces me to restart Parcel periodically. Very bad for user experience!
Can we please reopen this? This keeps happening to me as well and is super annoying.
Does it happen with parcel 2?
Parcel 1 is in maintenance mode so we probably won't fix this issue in Parcel 1 but if it still happens in Parcel 2 we should definitely try to fix it.
Luckily it does not happen very often, but unfortunately we can't reliably reproduce it and figure out it's root cause
So parcel 2 is not released yet and parcel 1 is only in maintenance mode... is this a good project state?
@saschagehlich Parcel 1 is pretty stable so I'd say so. (it's been used in various large companies in production for a couple years now) Why would it be a bad idea to not add new features and potentially introduce new bugs and issues into a tool that is gonna get replaced with a new version soon. This way we can focus on a certain version which in turn helps us release it sooner. Many companies and projects do this... Probably one of the most well-known projects that did this is Babel. I do have to admit that we did not anticipate Parcel 2 to take this long to reach the beta stage...
I completely understand that this is not a new feature but rather a bugfix, but at the same time it seems to reproduce and debug this issue it would take quite some time, which is probably better spend working on Parcel 2 as this bug does not occur a lot and does not have a large impact, you can restart the process and thanks to caching it shouldn't take more than a second.
Parcel 2 is also reaching a very stable point with a beta coming up really soon... and except for the api used for plugins nothing much will change from beta onward so anyone who wants can safely start testing and possibly migrating from Parcel 1 to Parcel 2