jimmywarting / wemo-client

JavaScript client library for controlling and subscribing to Wemo Devices
MIT License
132 stars 40 forks source link

Non-whitespace before first tag error #65

Open MichaelKohler opened 5 years ago

MichaelKohler commented 5 years ago

We're calling discover the following way where this._wemo is the wemo client instance without any specific options:

this._wemo.discover((error, deviceInfo) => {
   ...
});

From time to time, not always, according to our logs, this has the error parameter set with the error:

Non-whitespace before first tag

This seems to come from xml2js: https://github.com/Leonidas-from-XIV/node-xml2js/issues/345 https://github.com/Leonidas-from-XIV/node-xml2js/issues/390

Unfortunately I can't reproduce this reliably so I can't really debug it.

neophob commented 5 years ago

Maybe https://www.screenaware.com/en/blog/xml2js-sax-js-non-whitespace-before-first-tag (found it in the node-xml2js) is a work around?

timonreinhard commented 5 years ago

@MichaelKohler Does that apply to specific Wemo devices?

MichaelKohler commented 5 years ago

I honestly can't say, @neophob what do you think?

jimmywarting commented 2 years ago

wondering if it would help to trim some values beforehand somewhere...