# TypeError: Cannot read property 'log' of undefined

**URL:** <https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959>\
**Category:** General\
**Created:** [10 April 2021 12:35 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959 "2021-04-10T12:35:42Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![cope](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cope/32/34515_2.png) [@cope](https://discourse.nodered.org/u/cope)\
**Post date:** [10 April 2021 12:35 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/1 "2021-04-10T12:35:43Z")

</div>

I upgraded to 1.3.1 and now I cannot read my homeseer devices any more.

The server is declared all right and the Device and Feature are found by the node.  
The Device is in a red box???

 ![2021-04-10_143028](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/0/604169329daa7fd86383d9364cc183547e0e45ca.png)

Any idea how to solve this problem?

-- Cor --

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 April 2021 12:53 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/2 "2021-04-10T12:53:19Z")

</div>

what is the contrib node (node-red-contrib-????) you are using?

---

<div class="post-metadata">

**Author:** ![cope](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cope/32/34515_2.png) [@cope](https://discourse.nodered.org/u/cope)\
**Post date:** [10 April 2021 13:15 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/3 "2021-04-10T13:15:05Z")

</div>

node-red-contrib-homeseer version 1.0.5

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 April 2021 16:27 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/4 "2021-04-10T16:27:00Z")

</div>

Is this coming from the `hs-device` or `hs-event` node?

---

<div class="post-metadata">

**Author:** ![cope](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cope/32/34515_2.png) [@cope](https://discourse.nodered.org/u/cope)\
**Post date:** [10 April 2021 16:38 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/5 "2021-04-10T16:38:57Z")

</div>

it's from the HS-Device node

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 April 2021 16:42 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/6 "2021-04-10T16:42:46Z")

</div>

can you put a `catch` node connected to a `debug` node (set to display the complete msg object) on the tab with your node and see if something shows up. If it does, please expand the complete output of the debug and copy/paste it into a reply.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 April 2021 16:48 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/7 "2021-04-10T16:48:29Z")

</div>

You may want to open an issue on the node's github page: [Issues · HomeSeer/node-red-contrib-homeseer · GitHub](https://github.com/HomeSeer/node-red-contrib-homeseer/issues)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 April 2021 17:05 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/8 "2021-04-10T17:05:11Z")

</div>

> [@cope](#):
>
> from the HS-Device node

I suspect the problem is in the server (config) node...

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/5/d53f51438ea4fa48e97774d09d50c9334c319533.png)

... could you open the config (pencil icon next to HS4-server) and check its settings? Perhaps it is not properly configured and also the reason the device "refresh" button doesnt work?

Looking at the src for the server config node, the only place I see `.log` is where on the endpoints the node calls `RED.log.debug` ([example](https://github.com/HomeSeer/node-red-contrib-homeseer/blob/f148d7727b03425409a8f8102eb11f3519432f91/homeseer/hs-server.js#L230)) in which case it suggests an issue with the RED object being undefined!.

I checked in vscode on node-red V1.3.0 (not the homeseer node - a different node that also has built in endpoints) and `RED` is definitely an object containing `.log`  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/4/64ab4d9590eae8dbec476c31b278444c7c97b67a.png)

---

<div class="post-metadata">

**Author:** ![cope](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cope/32/34515_2.png) [@cope](https://discourse.nodered.org/u/cope)\
**Post date:** [11 April 2021 09:34 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/9 "2021-04-11T09:34:33Z")

</div>

Well, nothing shows up in de catch/debug window, only the same message as before: "TypeError: Cannot read property 'log' of undefined"

 ![2021-04-11_120852](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b95996be6f7be08a443091ce94e12174078ad4ad.png)

The HS4-server is configured all right.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [11 April 2021 15:45 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/10 "2021-04-11T15:45:21Z")

</div>

Like I said earlier, open an issue in the nodes GitHub page

---

<div class="post-metadata">

**Author:** ![cope](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cope/32/34515_2.png) [@cope](https://discourse.nodered.org/u/cope)\
**Post date:** [11 April 2021 17:13 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/11 "2021-04-11T17:13:39Z")

</div>

Yes indeed, and done! Thanks for the suggestion.

---

<div class="post-metadata">

**Author:** ![cope](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cope/32/34515_2.png) [@cope](https://discourse.nodered.org/u/cope)\
**Post date:** [12 April 2021 16:39 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/12 "2021-04-12T16:39:31Z")

</div>

Some feedback: problem solved in homeseer version 1.0.6

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 June 2021 16:40 UTC](https://discourse.nodered.org/t/typeerror-cannot-read-property-log-of-undefined/43959/13 "2021-06-11T16:40:25Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
