Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noobaa/core: remove global websocket #8514

Merged
merged 1 commit into from
Nov 10, 2024

Conversation

aspandey
Copy link
Contributor

@aspandey aspandey commented Nov 7, 2024

Prep PR for node 22

In node v22, websocket is enabled by default
nodejs/node#51594

This will cause an error on following line when the global.Websocket would be true.
const WS = global.WebSocket || require('ws');

global.WebSocket: This will points to Node.js's native WebSocket, which does not include a Server class.
require('ws'): The ws package includes both WebSocket and WebSocket.Server, but this fallback is skipped because global.WebSocket is already defined in Node.js v22

Copy link
Contributor

@naveenpaul1 naveenpaul1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

In node v22, websocket is enabled by default
nodejs/node#51594

This will cause an error on following line when the global.Websocket
would be true.
const WS = global.WebSocket || require('ws');

global.WebSocket: This will points to Node.js's native WebSocket,
which does not include a Server class.
require('ws'): The ws package includes both WebSocket and
WebSocket.Server, but this fallback is skipped because global.WebSocket
is already defined in Node.js v22

Signed-off-by: Ashish Pandey <[email protected]>
@aspandey aspandey merged commit fc266c3 into noobaa:master Nov 10, 2024
10 checks passed
@aspandey aspandey deleted the remove_global_websocket branch November 10, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants