luc-ass / homebridge-evohome

Homebridge plugin for Honeywell Evohome
29 stars 16 forks source link

syntax error token position 0 at jsonwith node 10.4.1 #40

Closed sapgitest closed 4 years ago

sapgitest commented 6 years ago

plugin has a problem with node 10.4.1 (which i had to upgrade because of an another plugin). at process._tickCallback (internal/process/next_tick.js:63:19) at endReadableNT (_stream_readable.js:1081:12) at IncomingMessage.emit (events.js:187:15) at IncomingMessage. (/usr/local/lib/node_modules/homebridge-evohome/node_modules/request/request.js:929:12) at Request.emit (events.js:187:15) at Request. (/usr/local/lib/node_modules/homebridge-evohome/node_modules/request/request.js:978:14) at Request.emit (events.js:182:13) at Request.self.callback (/usr/local/lib/node_modules/homebridge-evohome/node_modules/request/request.js:121:22) at Request._callback (/usr/local/lib/node_modules/homebridge-evohome/lib/evohome.js:254:29) at JSON.parse () [6/16/2018, 2:13:29 PM] [Evohome] Evohome Failed: SyntaxError: Unexpected token < in JSON at position 0 [6/16/2018, 2:13:28 PM] [Evohome] Logged into Evohome!

luc-ass commented 5 years ago

Strange. Have you got to the bottom of this?

luc-ass commented 5 years ago

Ok. So from what I can see here the response you get from Evohome seems to be a html document (hence the '<' at the beginning of the answer). It should be a json however. This seems strange to me as it would mean that the type of answer depends on the version of node.js...

I created a bugfix that specifies the type of answer that is expected.

Please try installing using: npm install -g git://github.com/luc-ass/homebridge-evohome.git#luc-ass_html-json-bug

I'd love to hear back from you!

luc-ass commented 4 years ago

ok, I'll mark this as closed as there has been no feedback.