# Custom Node error \[object Object\]

**URL:** https://discourse.nodered.org/t/custom-node-error-object-object/27239
**Category:** General
**Created:** [25 May 2020 08:00 UTC](https://discourse.nodered.org/t/custom-node-error-object-object/27239 "2020-05-25T08:00:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Serge](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Serge](https://discourse.nodered.org/u/Serge)
#### Post date: [25 May 2020 08:00 UTC](https://discourse.nodered.org/t/custom-node-error-object-object/27239/1 "2020-05-25T08:00:50Z")

</div>

I have a need for dynamic Websocket's for my project. However this isn't supported by the core nodes.

I came across VIKRAMAS's posts on this forum, about the nodes he has written with dynamic Websocket support.  
Here: [Custom node is not adding to Node-red](https://discourse.nodered.org/t/custom-node-is-not-adding-to-node-red/21475)  
And here: [Node red custom websocket how to handle connections](https://discourse.nodered.org/t/node-red-custom-websocket-how-to-handle-connections/24145)

Unfortunately, after I created the custom Node with supplied code. I get an error "[object Object]" under palette manager and the custom node does not load.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/3/3302ddbc0725528a5064605e862d89c98ddff5eb.png)

Can anyone please help me trouble shoot why I get this error and unable to load the custom node?  
As I was able to follow example/s and create my first custom Nodes "lower-case" without any issues. Using ether the npm link or npm install method for adding new custom nodes.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [25 May 2020 08:18 UTC](https://discourse.nodered.org/t/custom-node-error-object-object/27239/2 "2020-05-25T08:18:22Z")

</div>

The error would have been logged by the runtime when Node-RED was starting up.

We also fixed displaying the error properly in 1.0.5 or .6 so you don't just get `[object Object]`

---

<div class="post-metadata">

### Author: ![Serge](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Serge](https://discourse.nodered.org/u/Serge)
#### Post date: [25 May 2020 09:38 UTC](https://discourse.nodered.org/t/custom-node-error-object-object/27239/3 "2020-05-25T09:38:13Z")

</div>

Hi knolleary, thanks for the quick reply.  
I updated to the latest v1.0.6, still get the same [object Object] error displayed.  
On Node-Red startup I get this error for the module:

> 25 May 19:32:59 - [warn] [node-red-contrib-websocketlistener/websocketlistener] ReferenceError: RED is not defined

---

<div class="post-metadata">

### Author: ![Serge](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@Serge](https://discourse.nodered.org/u/Serge)
#### Post date: [25 May 2020 09:52 UTC](https://discourse.nodered.org/t/custom-node-error-object-object/27239/4 "2020-05-25T09:52:32Z")

</div>

Realised what that error was. Was missing "module.exports = function(RED) {" as the start of the .js file.

---

<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: [8 June 2020 09:52 UTC](https://discourse.nodered.org/t/custom-node-error-object-object/27239/5 "2020-06-08T09:52:42Z")

</div>

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