# SyntaxError: Unexpected token Since update 3.3.2

**URL:** <https://community.homey.app/t/syntaxerror-unexpected-token-since-update-3-3-2/64578>\
**Category:** Questions & Help\
**Tags:** homeyscript\
**Created:** [June 10, 2022, 6:02pm UTC](https://community.homey.app/t/syntaxerror-unexpected-token-since-update-3-3-2/64578 "2022-06-10T18:02:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeroen\_W](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_w/32/9803_2.png) [@Jeroen\_W](https://community.homey.app/u/Jeroen_W)\
**Post date:** [June 10, 2022, 6:02pm UTC](https://community.homey.app/t/syntaxerror-unexpected-token-since-update-3-3-2/64578/1 "2022-06-10T18:02:26Z")

</div>

Since the update from homeyscript 3.3.2 my script isn’t working anymore.  
I dont’t know why it’s not working anymore

There Error

> Blockquote  
> ———————————————————  
> ❌ Script Error  
> ⚠ SyntaxError: Unexpected token u in JSON at position 0  
> at JSON.parse ()  
> at WarmWaterMeterStand.js:1:22  
> at processTicksAndRejections (node:internal/process/task\_queues:96:5)

The script

> Blockquote  
> const payload = JSON.parse(args[0]);  
> setTagValue(‘energy’, { type: ‘number’, title : ‘energy’ }, payload.energy);  
> setTagValue(‘temp in’, { type: ‘number’, title : ‘temp1’ }, payload.temp1);  
> setTagValue(‘temp uit’, { type: ‘number’, title : ‘temp2’ }, payload.temp2);  
> setTagValue(‘flow’, { type: ‘number’, title : ‘flow’ }, payload.flow);  
> setTagValue(‘volume’, { type: ‘number’, title : ‘volume’ }, payload.volume);  
> return true;

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [June 10, 2022, 6:42pm UTC](https://community.homey.app/t/syntaxerror-unexpected-token-since-update-3-3-2/64578/2 "2022-06-10T18:42:01Z")

</div>

Your JSON is not valid. If the message is right, it starts with a ‘u’, not with a {.  
Can you check the response of the http GET (I think you are reading it this way).

PS: u could come from undefined (?). Is you array ok and has one entry?

---

<div class="post-metadata">

**Author:** ![Jeroen\_W](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_w/32/9803_2.png) [@Jeroen\_W](https://community.homey.app/u/Jeroen_W)\
**Post date:** [June 10, 2022, 7:48pm UTC](https://community.homey.app/t/syntaxerror-unexpected-token-since-update-3-3-2/64578/3 "2022-06-10T19:48:30Z")

</div>

Hi Ronny,

Strange thing is, it worked for more than a year.  
This is the MQTT broker info in homey, i cannot find the “u”

> 0220610-19:36:25 received ‘{“energy”: 21.93, “volume”: 262.897, “temp1”: 57.74, “temp2”: 54.71, “flow”: 9.0}’ on ‘kamstrup/values’  
> 20220610-19:36:36 OnMessage called  
> 20220610-19:36:36 received ‘{“energy”: 21.93, “volume”: 262.897, “temp1”: 57.74, “temp2”: 54.71, “flow”: 9.0}’ on ‘kamstrup/values’  
> 20220610-19:36:47 OnMessage called  
> 20220610-19:36:47 received ‘{“energy”: 21.93, “volume”: 262.897, “temp1”: 57.74, “temp2”: 54.71, “flow”: 9.0}’ on ‘kamstrup/values’  
> 20220610-19:36:58 OnMessage called

I have this flow; For testing I removed the homeyscript card and flow start card. And added a telegram message to my. But that won’t trigger either…

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/e/4ed346c445930b36eb85a1d2824ff1e2fecd88dd.png)

Solved… Restarted the MQTT app in Homey.  
Stupid i didn’t do this at first… Thanks anyway for your help.
