# Config node not showing

**URL:** https://discourse.nodered.org/t/config-node-not-showing/72776
**Category:** Developing Nodes
**Created:** [27 December 2022 15:22 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776 "2022-12-27T15:22:33Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Richardmarobert](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/richardmarobert/32/73257_2.png) [@Richardmarobert](https://discourse.nodered.org/u/Richardmarobert)
#### Post date: [27 December 2022 15:22 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/1 "2022-12-27T15:22:33Z")

</div>

Hi, I am trying to create a custom node and the only item I am struggling with is the config node. I have created the files ' anna.js / anna.html /anna-config.js/anna-config.html and a package.json; I've mentioned the nodes in my package.json under node-red/nodes, referenced the property of my ' remote server' in the input of the anna.html, called the node in the anna.js; and the node is showing in NR under the category I have set, I can see the config node in the pallette, but when I open the node, there is no configuration option given. I am sure I am overlooking something simple, but I can't seem to find it. Any hints are appreciated. Files are below:

anna-config.html

```auto
<script type="text/javascript">
    RED.nodes.registerType('anna-config',{
        category: 'config',
        color: '#af3',
        defaults: {
            host: {value:"",required:true},
            ip: {value:"", required: true},
            },
            
        	credentials:{
            	{username:"",required: true, type :"text"},
            	{password:"", required: true, type:"password"},
            },
            label : function() {
            return this.host+":"+this.ip;
            }
            
    });
</script>

<script type="text/html" data-template-name="anna-config">
    <div class="form-row">
        <label for="node-config-input-host"><i class="fa fa-tag"></i> Name</label>
        <input type="text" id="node-config-input-host" placeholder="smile">
    </div> 
    <div class="form-row">
        <label for="node-config-input-ip"><i class="fa fa-tag"></i> ip adres</label>
        <input type="text" id="node-config-input-ip" placeholder="">
    </div>
    <div class="form-row">
        <label for="node-config-input-username"><i class="fa fa-tag"></i> smile</label>
        <input type="text" id="node-config-input-username" placeholder="">
    </div>
    <div class="form-row">
        <label for="node-config-input-password"><i class="fa fa-tag"></i> password</label>
        <input type="text" id="node-config-input-password" placeholder="">
    </div>
</script>

<script type="text/html" data-help-name="anna-config">
    <p>A simple node that converts the message payloads into all lower-case characters</p>
</script>

```

anna-config.js

```auto
module.exports = function(RED){

function smile(config)	{
		RED.nodes.createNode(this,config);
		
			this.host = config.host;
			this.ip = config.ip; 

        }
		
	RED.nodes.registerType("anna-config", smile);
        }

```

anna.html

```auto
<script type="text/javascript">
    RED.nodes.registerType('anna',{
        category: 'Thermostaat',
        color: '#af3',
        defaults: {
            name: {value:""},
            smile: {value:"", type:"anna-config"},
        	},
        inputs:1,
        outputs:1,
        icon: "file.png",
        label: function() {
		return this.smile||"anna";
        }
    });
</script>

<script type="text/html" data-template-name="anna">
    <div class="form-row">
        <label for="node-input-name"><i class="icon-tag"></i> Name</label>
        <input type="text" id="node-input-name" placeholder="naam">
    </div> 
    
    <div class="form-row">
        <label for="node-input-smile"><i class="icon-tag"></i>Smile</label>
        <input type="text" id="node-input-smile" placeholder="">
    </div>

</script>

<script type="text/html" data-help-name="anna">
    <p>A simple node that converts the message payloads into all lower-case characters</p>
</script>

```

anna.js

```auto

module.exports = function(RED){

	function anna(config){
	
		RED.nodes.createNode(this,config);
		
		 this.smile = RED.nodes.getNode(config.smile);
		 	
		 	
		 
 		if (this.smile) {
            // Do something with:
            // this.server.host
            // this.server.port
        } else {
            // No config node configured
        }
    }
RED.nodes.registerType("anna", anna);
}

```

package.json

```auto
{
  "name": "node-red-contrib-anna",
  "version": "1.0.0",
  "description": "anna",

    "node-red" : {
          "nodes": {
            "anna": "anna.js",
            "anna-config": "anna-config.js"
          	}
    }
}

```

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [27 December 2022 16:11 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/2 "2022-12-27T16:11:57Z")

</div>

Hi @Richardmarobert!  
Welcome to this forum!

There are a few things I can annotate - unsure if this is going to solve your issue:

> [@Richardmarobert](#):
>
> package.json
> 
> ```auto
> {
> "name": "node-red-contrib-anna",
> "version": "1.0.0",
> "description": "anna",
> 
> "node-red" : {
> "nodes": {
> "anna": "anna.js",
> "anna-config": "anna-config.js"
> }
> }
> }
> 
> ```

A config node (usually) will not be exposed in the `node-red/nodes` object - as it is not supposed to be accessible via the palette.  
If Node-RED isn't loading `anna-config`: Did you try to put both classes (`anna` & `anna-config`) in the same file?

> [@Richardmarobert](#):
>
> ```auto
> <div class="form-row">
> <label for="node-input-smile"><i class="icon-tag"></i>Smile</label>
> <input type="text" id="node-input-smile" placeholder="">
> </div>
> 
> ```

It is enough to define `<input id="node-input-smile">`; no type necessary!

---

<div class="post-metadata">

### Author: ![Richardmarobert](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/richardmarobert/32/73257_2.png) [@Richardmarobert](https://discourse.nodered.org/u/Richardmarobert)
#### Post date: [27 December 2022 16:19 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/3 "2022-12-27T16:19:42Z")

</div>

Hi @ralphwetzel , thank you!

Node-red is loading / showing the config node, in the configuration palette without any errors. The normal Anna-node is also showing, and I can put it on the canvas. But what I would expect is when I open the properties of the node, to have the configuration option available; to add the properties of the Anna-config. But this is not showing. The annoying part is, that I have been able to do it before.

---

<div class="post-metadata">

### Author: ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)
#### Post date: [27 December 2022 17:02 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/4 "2022-12-27T17:02:52Z")

</div>

Don't you have a syntax error in anna-config.html? The indentation doesn't match the {} nesting. Look in the browser console.

---

<div class="post-metadata">

### Author: ![Richardmarobert](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/richardmarobert/32/73257_2.png) [@Richardmarobert](https://discourse.nodered.org/u/Richardmarobert)
#### Post date: [27 December 2022 17:08 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/5 "2022-12-27T17:08:45Z")

</div>

thanks @tve !

I probably have - and corrected it. It wasn't a critical error, though. Didn't change the behavior, unfortunately. Thank you for spotting it, though!

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [27 December 2022 17:13 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/6 "2022-12-27T17:13:35Z")

</div>

> [@Richardmarobert](#):
>
> in the configuration palette without any errors

There's no "configuration palette" I'm aware of. Could you please provide a screenshot so we're talking about the same part of Node-RED?

> [@Richardmarobert](#):
>
> But this is not showing.

Here as well a screenshot would be helpful...

---

<div class="post-metadata">

### Author: ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)
#### Post date: [27 December 2022 17:15 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/7 "2022-12-27T17:15:43Z")

</div>

> [@Richardmarobert](#):
>
> thanks @tve !
> 
> I probably have - and corrected it. It wasn't a critical error, though. Didn't change the behavior, unfortunately. Thank you for spotting it, though!

If you're not posting the code **verbatim** then how do you expect us to help you??

"Hey, it's not working, this is approximately what my code looks like"??

---

<div class="post-metadata">

### Author: ![Richardmarobert](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/richardmarobert/32/73257_2.png) [@Richardmarobert](https://discourse.nodered.org/u/Richardmarobert)
#### Post date: [27 December 2022 17:45 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/8 "2022-12-27T17:45:34Z")

</div>

@ralphwetzel sorry for being not clear. The configuration node is not appearing - see the screenshot. If I look at the palette, two nodes appear - one of them being the configuration node.

 ![Schermafbeelding 2022-12-27 om 18.19.56](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/4/74a4a33df7c191d0845469c55324dd7a14d1118e.png)

 ![Schermafbeelding 2022-12-27 om 18.19.23](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/0/906468d9707cdc5c3412daf0d10e608891548996.png)

---

<div class="post-metadata">

### Author: ![Richardmarobert](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/richardmarobert/32/73257_2.png) [@Richardmarobert](https://discourse.nodered.org/u/Richardmarobert)
#### Post date: [27 December 2022 17:46 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/9 "2022-12-27T17:46:17Z")

</div>

@tve I don't expect anything. Any help is welcome; like - what is the code verbatim ?

---

<div class="post-metadata">

### Author: ![tve](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/tve/32/59475_2.png) [@tve](https://discourse.nodered.org/u/tve)
#### Post date: [27 December 2022 18:03 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/10 "2022-12-27T18:03:07Z")

</div>

> [@Richardmarobert](#):
>
> - what is the code verbatim ?

Posting the code you have verbatim (exactly). Not some approximation before you made some more changes and fixed some bugs...

It takes time to read your posts and read the code and look for what doesn't match. The least you can do is post the exact code and exact symptoms. Also uploading your node to github or similar is a good idea so someone can easily install it to see the issue...

---

<div class="post-metadata">

### Author: ![Richardmarobert](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/richardmarobert/32/73257_2.png) [@Richardmarobert](https://discourse.nodered.org/u/Richardmarobert)
#### Post date: [27 December 2022 18:17 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/11 "2022-12-27T18:17:51Z")

</div>

@tve ah, thank you. It was -and now is - the exact code, tbh. I have deleted the additional } after you mentioned it and it didn't change the behavior. Pardon my ignorance.

Thanks for the suggestion to upload it to GitHub:

> **[GitHub - Richardmarobert/anna: My first node-red plugin](https://github.com/Richardmarobert/anna)**
>
> My first node-red plugin. Contribute to Richardmarobert/anna development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [27 December 2022 18:56 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/12 "2022-12-27T18:56:40Z")

</div>

@Richardmarobert Have you noted the naming requirement for node-RED contrib nodes?  
[https://nodered.org/docs/creating-nodes/packaging#naming](https://nodered.org/docs/creating-nodes/packaging#naming)

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [27 December 2022 19:08 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/13 "2022-12-27T19:08:05Z")

</div>

> [@Richardmarobert](#):
>
> ```auto
> credentials:{
> {username:"",required: true, type :"text"},
> {password:"", required: true, type:"password"},
> },
> 
> ```

This is your issue: Your syntax for the credentials object is wrong. You're missing the property identifiers:

```javascript
        	credentials:{
            	p1: {username:"",required: true, type :"text"},
            	p2: {password:"", required: true, type:"password"},
            },

```

There's another typo in the file you posted on GitHub:  
`<s cript>`

As a side note: `VS Code` was flagging this in the second I opened the file. You should get a hand on this or another IDE to support your development activities. Saves you a lot of trouble...

---

<div class="post-metadata">

### Author: ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)
#### Post date: [27 December 2022 19:16 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/14 "2022-12-27T19:16:15Z")

</div>

> [@Richardmarobert](#):
>
> The configuration node is not appearing - see the screenshot.

Final statement: `anna-config` will show up in the config side panel only after it's been configured at least once. That's why it doesn't appear where you're looking for it.  
Once configured, it's there:

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

---

<div class="post-metadata">

### Author: ![Richardmarobert](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/richardmarobert/32/73257_2.png) [@Richardmarobert](https://discourse.nodered.org/u/Richardmarobert)
#### Post date: [28 December 2022 19:38 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/15 "2022-12-28T19:38:15Z")

</div>

@ralphwetzel The IDE suggestion did it. The credentials were within an additional set of brackets, too much as Visual Code pointed out quickly. Thanks, problem solved.

---

<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 January 2023 19:38 UTC](https://discourse.nodered.org/t/config-node-not-showing/72776/16 "2023-01-11T19:38:51Z")

</div>

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