# Creating custom node breaks ui\_button

**URL:** <https://discourse.nodered.org/t/creating-custom-node-breaks-ui-button/33711>\
**Category:** Dashboard\
**Created:** [3 October 2020 20:58 UTC](https://discourse.nodered.org/t/creating-custom-node-breaks-ui-button/33711 "2020-10-03T20:58:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![murjam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/murjam/32/29611_2.png) [@murjam](https://discourse.nodered.org/u/murjam)\
**Post date:** [3 October 2020 20:58 UTC](https://discourse.nodered.org/t/creating-custom-node-breaks-ui-button/33711/1 "2020-10-03T20:58:31Z")

</div>

Hi! I have an issue - whenever I add a custom node to my node-red, the ui\_buttons that I have on my dashboard lose their input "port". Trying to deploy the flows would yield that those elements are not properly configured.

At first I thought -- fair enough, I probably broke it somehow with my custom code, but now I have cut my custom object down to the `lower-case` example component and the same thing still happens.

How to debug? Thanks for hints! 🙏

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [3 October 2020 22:02 UTC](https://discourse.nodered.org/t/creating-custom-node-breaks-ui-button/33711/2 "2020-10-03T22:02:48Z")

</div>

Please check both the Node-RED log and your browser console for any errors and let us know.

This kind of thing can happen due to poorly isolated code in a node - I know because I've done it myself!

These days, I try to remember to wrap my code in an IIFE:

```auto
....

<script type="text/javascript">
;(function () { // Isolate the front-end code
    'use strict'

    RED.nodes.registerType('moment',{

        // ....

    }); // ---- end of RED.nodes.registerType ---- //
})()
</script>

```

---

<div class="post-metadata">

**Author:** ![murjam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/murjam/32/29611_2.png) [@murjam](https://discourse.nodered.org/u/murjam)\
**Post date:** [12 October 2020 20:13 UTC](https://discourse.nodered.org/t/creating-custom-node-breaks-ui-button/33711/3 "2020-10-12T20:13:37Z")

</div>

Thanks for the hint and sorry for the late reply!

Finally digged into making it work today, and although it took me way too long trial-and-error, I finally figured out that it _somehow_ was caused by having `node-red-dashboard` as well as `node-red-contrib-ui` both installed (both register ui\_button component).

I am not sure how exactly my custom component broke it, but once I finally removed `node-red-contrib-ui`, everything started to work as expected 🎉

---

<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:** [26 October 2020 20:13 UTC](https://discourse.nodered.org/t/creating-custom-node-breaks-ui-button/33711/4 "2020-10-26T20:13:45Z")

</div>

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