# RED.plugins.registerPlugin is not called

**URL:** <https://discourse.nodered.org/t/red-plugins-registerplugin-is-not-called/88965>\
**Category:** Developing Nodes\
**Created:** [26 June 2024 08:36 UTC](https://discourse.nodered.org/t/red-plugins-registerplugin-is-not-called/88965 "2024-06-26T08:36:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bfany365](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bfany365/32/92044_2.png) [@bfany365](https://discourse.nodered.org/u/bfany365)\
**Post date:** [26 June 2024 08:36 UTC](https://discourse.nodered.org/t/red-plugins-registerplugin-is-not-called/88965/1 "2024-06-26T08:36:10Z")

</div>

Hi  
I have developed a simple plugin, the associated js file is never called although the associated html file is loaded.

Therefore the code I have for `RED.plugins.registerPlugin` seems to be never triggered:

> myplugin.js:

```auto
module.exports = async function (RED) {
        RED.httpAdmin.post('/test', RED.auth.needsPermission('notify.write'), async function (req, res) {
        
	});

    
    RED.plugins.registerPlugin('myplugin', { type: 'myplugin',
        onadd: function() {
            console.log('plugin added')
        }
      });
};

```

> package.json

```auto
"node-red": {
    "version": ">=3.1.0",
    "plugins": {
      "myplugin": "myplugin.js"
    }
  },

```

  

**ADMIN EDIT: Use code blocks for code**

---

<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:** [26 June 2024 09:21 UTC](https://discourse.nodered.org/t/red-plugins-registerplugin-is-not-called/88965/2 "2024-06-26T09:21:51Z")

</div>

You seem to have a mix of client side code and server side logic.

See this gist: [Example Node-RED that adds a sidebar panel in the editor · GitHub](https://gist.github.com/knolleary/2b5cf9f79a435180f6f7295e3967d9b9)

---

<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:** [10 July 2024 09:22 UTC](https://discourse.nodered.org/t/red-plugins-registerplugin-is-not-called/88965/3 "2024-07-10T09:22:25Z")

</div>

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