wemo-client
wemo-client copied to clipboard
Non-whitespace before first tag error
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.
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?
@MichaelKohler Does that apply to specific Wemo devices?
I honestly can't say, @neophob what do you think?
wondering if it would help to trim some values beforehand somewhere...