wemo-client icon indicating copy to clipboard operation
wemo-client copied to clipboard

Non-whitespace before first tag error

Open MichaelKohler opened this issue 6 years ago • 4 comments

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.

MichaelKohler avatar Nov 14 '18 09:11 MichaelKohler

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?

neophob avatar Nov 14 '18 10:11 neophob

@MichaelKohler Does that apply to specific Wemo devices?

timonreinhard avatar Nov 27 '18 14:11 timonreinhard

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

MichaelKohler avatar Nov 27 '18 14:11 MichaelKohler

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

jimmywarting avatar Jan 26 '22 23:01 jimmywarting