-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Version 1.5.2 breaks y-websocket in the browser #166
Comments
This is happening for me as well.
Reference: if (typeof process !== 'undefined') {
process.on('exit', this._exitHandler)
} |
Note that this only happens because you are using a bundler (or some extension) that tries to polyfill nodejs. I added an environment check to avoid this. Let me know if this doesn't fix the issue. If not, please supply the specific build steps that cause the issue. |
This worked for me, thanks. I am using vite 5.0.11. Incidentally, this same issue manifested at the same time in another package I'm using. |
@dmonad thanks for adding environment check! Small note, the check was not added to the y-websocket/src/y-websocket.js Lines 402 to 404 in 25ee3f0
Can you add the |
Describe the bug
On
new WebsocketProvider
the following error is thrown.To Reproduce
Expected behavior
No error
Screenshots
If applicable, add screenshots to help explain your problem.
Environment Information
Additional context
So in commit 882ac9e the logic for (if I read correctly) detecting if it is running in a browser was removed. It is weird, because the original PR #165 keeps this intact so maybe the PR merge went wrong?
882ac9e#diff-bf6cbbe721bbeff64c972b548f6291dc24bba8fd0e1cef5b91d87513c6a0b362L403-L405
The text was updated successfully, but these errors were encountered: