Skip to content

Commit

Permalink
Merge pull request #175 from jblyberg/polyfill-fix
Browse files Browse the repository at this point in the history
fix "TypeError: process.off is not a function" with bundlers
  • Loading branch information
dmonad authored Feb 20, 2024
2 parents 25ee3f0 + b25c89c commit 93dfcf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/y-websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ export class WebsocketProvider extends Observable {
}
clearInterval(this._checkInterval)
this.disconnect()
if (typeof process !== 'undefined') {
if (env.isNode && typeof process !== 'undefined') {
process.off('exit', this._exitHandler)
}
this.awareness.off('update', this._awarenessUpdateHandler)
Expand Down

0 comments on commit 93dfcf7

Please sign in to comment.