Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error : {} TypeError: Cannot read property 'sunrise' of undefined

ANSWERED

I'm getting the following message when trying to test my clock face:

[2:29:07 PM] Companion: On message {"isTrusted":false} (companion/index.js:48,3)
[2:29:07 PM] Companion: Latitude: 48.1076184063 Longitude: 11.6960995793 (companion/index.js:36,3)
[2:29:07 PM] Companion: The 'permission' API is not yet supported in the Fitbit OS Simulator. Behavior may not match the documentation or real devices.
[2:29:07 PM] Companion: Error : {} TypeError: Cannot read property 'sunrise' of undefined (companion/index.js:17,3)

 I'm fairly new to javascript, and I can't figure out what the bug is. I would be so appreciative of any pointers. Here's my code:

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

I'm wondering whether data.sys could be undefined in _queryOWMWeather(). I haven't used that API so I'm not familiar with its response.

Don't worry about the 'permission' message; that's normal on sim.

Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

I'm wondering whether data.sys could be undefined in _queryOWMWeather(). I haven't used that API so I'm not familiar with its response.

Don't worry about the 'permission' message; that's normal on sim.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

That was it! I was switching over from an older API and missed that one.

Can you help me understand the "On message {"isTrusted":false}" log?

Is there any issue that it's set to false? I feel like something being trusted should be set to true, but I'm not entirely sure where this is coming from. 

Best Answer
0 Votes

That's a strange one. It seems to be an undocumented property of MessageEvent. I've never noticed it before (but I haven't looked).

My solution would be not to log it. 😉

Peter McLennan
Gondwana Software
Best Answer
0 Votes