# Waiting for missing types to be registered

**URL:** <https://discourse.nodered.org/t/waiting-for-missing-types-to-be-registered/9282>\
**Category:** Dashboard\
**Created:** [21 March 2019 16:06 UTC](https://discourse.nodered.org/t/waiting-for-missing-types-to-be-registered/9282 "2019-03-21T16:06:21Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![peret2000](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/peret2000/32/20682_2.png) [@peret2000](https://discourse.nodered.org/u/peret2000)\
**Post date:** [13 April 2020 08:49 UTC](https://discourse.nodered.org/t/waiting-for-missing-types-to-be-registered/9282/13 "2020-04-13T08:49:18Z")

</div>

I have managed to see the problem; .js code was wrong. Two errors:

- Using module.export instead of module.exports
- Code inside exported function was not correc. This is teh correct version:

```auto
module.exports = function(RED) {
        "use strict";

        function ExampleNode(config) {
                RED.nodes.createNode(this,config);

                var node = this;

                this.on("input"), function(msg) {
                        if (typeof msg.payload === "string") {
                                msg.payload = msg.payload.toLowerCase();
                                node.send(msg);
                        } else {
                                node.error("Payload is not a String", msg);
                        }
                }

        }

        RED.nodes.registerType("example", ExampleNode);

};

```

What is difficult to me is to detect these kind of errors: java script is too permisive with data, so you can declare or use data out of scope, and nothing happens. Thanks

---

_[View the full topic](https://discourse.nodered.org/t/waiting-for-missing-types-to-be-registered/9282)._
