The examples use reconnecting-websocket, but that package has not been published in over 4 years.
There is an active for of that package called partysocket. https://www.npmjs.com/package/partysocket
It might be worth considering upgrading the examples to use it, as it's better maintained.