Upgraded ws to 8.17.1 and solved some issues #2415
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces #2413
Why need replacing? Because
packages/gui/node_modules/ws
remains8.14.1
inpackage-lock.json
and vulnerability still opens.ws@8.17.1
doesn't work withpackages/gui
since it added a conditonal exports to its ownpackage.json
like below.When building code with
webpack
, it treats electron-renderer code (mostly React components) as browser code by the above exports entry.This is the problem, since the content of
ws/browser.js
isSo when you try to instantiate
WebSocket
, it immediately throws.Solutions to the above issues
ws
frompackages/gui
bynpm un ws -w @chia-network/gui
then re-addws
bynpm i ws -w @chia-network/gui
. After the re-installation, runnpm audit fix
to upgradews
to vuln-free version.packages/gui/webpack.react.babel.ts