node-sonos-discovery
node-sonos-discovery copied to clipboard
Uncaught (in promise) TypeError: Cannot read property 'baseUrl' of undefined
I just switched networks and ran this line:
let discovery = new SonosDiscovery(sonosDiscoverySettings);
and getting the error:
Uncaught (in promise) TypeError: Cannot read property 'baseUrl' of undefined
at NotificationListener.topologyChange (/Users/andy/dev-git/ElectroKC/node_modules/sonos-discovery/lib/SonosSystem.js:109)
at NotificationListener.emit (events.js:182)
at parseTopology.then (/Users/andy/dev-git/ElectroKC/node_modules/sonos-discovery/lib/NotificationListener.js:117)
at process._tickCallback (internal/process/next_tick.js:68)
the error appears here (SonosSystem.js around line 109):
// Update available services
const anyPlayer = _this.getAnyPlayer();
soap.invoke(`${anyPlayer.baseUrl}/MusicServices/Control`, soap.TYPE.ListAvailableServices)
I have a player here, but even if not - it should not throw, or?
Any idea or mechanism to recover from this situation?
Here's a bit more information: I removed one of my SonosOne speakers from a stereo-pair into a new network. What I didn't do was to split the stereo-pair. So Sonos showed me the room, with a question-mark (as one speaker) and the other speaker. This triggered the error. After I split the speaker-pair the problem disappeared... (btw: Sonos own desktop app didn't find the speakers as well - just the iOS.app showed the problem)