When Node.js cannot be detected, but the app is server-side rendered, the following import statement fails due to initializing an instance of LocalStorage. We should introduce an SSR flag (mode) and re-implement the broadcastchannel with some lazy initialization for the LocalStorage, so that it will only be created when disableBc = false.
When Node.js cannot be detected, but the app is server-side rendered, the following import statement fails due to initializing an instance of
LocalStorage
. We should introduce an SSR flag (mode) and re-implement thebroadcastchannel
with some lazy initialization for theLocalStorage
, so that it will only be created whendisableBc = false
.https://github.com/y-crdt/yrb-actioncable/blob/main/packages/yrb-actioncable/src/websocket-provider.ts#L2