-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(WebSocketSubject): Check if WebSocket exists before using it #3694
Conversation
@@ -7,6 +7,7 @@ import { ReplaySubject } from '../../ReplaySubject'; | |||
import { Observer, NextObserver } from '../../types'; | |||
import { tryCatch } from '../../util/tryCatch'; | |||
import { errorObject } from '../../util/errorObject'; | |||
import { root } from '../../util/root'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want to get away from using root
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benlesh Updated this to remove root
and just see if WebSocket
exists in the global scope. Is there a specific reason we're moving away from using root
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It causes weird issues with some bundling setups, and it's just unnecessary code for the most part.
thanks, @bbonnet! |
Description:
Check to make sure that the
WebSocket
constructor is in the root before using it. This is currently breaking in Node.Related issue (if exists):
#3692