Waiting for missing types to be registered

Hello,

I've some problems with a node that I've made. This node use request to do a simple get request to any server. When I used the node for first time, it run well. Now, I change de project to add new nodes and the first node doesn't work. When I try it, I recieve a notification that said: "Waiting for missing types to be registered: fiware-in" (fiware-in is the name of the node.

I try a lot of solutions, but anything runs.

Thanks!

Hi @trujillo - welcome.

That means Node-RED has not been able to load your custom module for some reason. It will have reported any errors it hit trying to load your node in the log - so that's the place to look first.

Before, I can see the modules in the command windows but now I can't. However, I can see the nodes in the palette and I can use it in the flow. When I deploy, the problems starts.

Show us the whole log, up to when the error occurs. If possible please copy/paste here from the terminal. You can use Ctrl+Shift+C to copy from the terminal.

This is my cmd when I deploy the node:

C:\Users\Trujillo.node-red>node-red scratch.js
22 Mar 09:07:53 - [info]

Welcome to Node-RED

22 Mar 09:07:53 - [info] Node-RED version: v0.20.2
22 Mar 09:07:53 - [info] Node.js version: v10.15.3
22 Mar 09:07:53 - [info] Windows_NT 10.0.17134 x64 LE
22 Mar 09:07:54 - [info] Loading palette nodes
22 Mar 09:07:56 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
22 Mar 09:07:56 - [info] Settings file : \Users\Trujillo.node-red\settings.js
22 Mar 09:07:56 - [info] Context store : 'default' [module=memory]
22 Mar 09:07:56 - [info] User directory : \Users\Trujillo.node-red
22 Mar 09:07:56 - [warn] Projects disabled : editorTheme.projects.enabled=false
22 Mar 09:07:56 - [info] Flows file : C:\Users\Trujillo.node-red\scratch.js
22 Mar 09:07:56 - [warn]


Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

22 Mar 09:07:56 - [info] Starting flows
22 Mar 09:07:56 - [info] Started flows
22 Mar 09:07:56 - [info] Server now running at http://127.0.0.1:1880/
22 Mar 09:09:02 - [info] Stopping flows
22 Mar 09:09:02 - [info] Stopped flows
22 Mar 09:09:02 - [info] Waiting for missing types to be registered:
22 Mar 09:09:02 - [info] - fiware-in
22 Mar 09:09:06 - [info] Stopping flows
22 Mar 09:09:06 - [info] Stopped flows

@Colin Is this that you said it?

Given there are no errors at the start - around the 'Loading palette nodes' line - then the most simple explanation is it hasn't found a module that provides the type fiware-in.

If you take a look in the file ~/.node-red/.config.json you'll see a list of all the modules node-red has loaded and where they came from. Check your module is listed in there.

image

The node is in the file that you comment. You can see fiware-out and fiware-in, the first runs well but the second has the problem and I don't know how repair it.

Thanks!

The runtime first identifies what types a node provides by scanning its html file - that is where the array of types comes from that you can see on line 502 in that screenshot.

It assumes the node's javascript file will actually register a node of that type.

But the error you are hitting tells us the javascript is not calling RED.nodes.registerType() with a type of "fiware-in". That would be the next thing for you to check.

This is the beginning of mi fiware-in.html. In the js file, RED.nodes.registerType() has 'fiware-in' too.

Thanks a lot for your comments!

You've shown the .html file - but its the .js file that determines what gets loaded in the runtime.

Ok, the js has an error.

Thank you very much! I solve my problem!

Thanks!

Hello,
I am facing exactly the same issue. I am learning how to create nodes, and having this same error. the difference is, as far as I can see, that I am declaring correctly the call to the neccessary type (in my case 'example') from RED.nodes.registerType().

This is the log of node-red:

Welcome to Node-RED
===================

12 Apr 18:24:22 - [info] Node-RED version: v1.0.4
12 Apr 18:24:22 - [info] Node.js  version: v12.16.1
12 Apr 18:24:22 - [info] Linux 4.15.0-1063-aws x64 LE
12 Apr 18:24:22 - [info] Loading palette nodes
12 Apr 18:24:23 - [info] Worldmap version 2.2.1
12 Apr 18:24:24 - [info] Dashboard version 2.19.4 started at /ui
12 Apr 18:24:24 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
12 Apr 18:24:24 - [info] Settings file  : /home/usuario/.node-red/settings.js
12 Apr 18:24:24 - [info] Context store  : 'storeInFile' [module=localfilesystem]
12 Apr 18:24:24 - [info] Context store  : 'default' [module=memory]
12 Apr 18:24:24 - [info] User directory : /home/usuario/.node-red
12 Apr 18:24:24 - [info] Server now running at http://127.0.0.1:20481/
12 Apr 18:24:24 - [info] Active project : NodeRED
12 Apr 18:24:24 - [info] Flows file     : /home/usuario/.node-red/projects/NodeRED/flows_raspberrypi.json
12 Apr 18:24:24 - [info] Waiting for missing types to be registered:
12 Apr 18:24:24 - [info]  - example

This is the .js file:

module.export = function(RED) {

        function ExampleNode(config) {
                RED.nodes.createNode(this,config);
                var node = this;
        }

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

        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);
                }
        }

}

The .html:

<script type="text/javascript">
    RED.nodes.registerType('example', {
        color: "#62796E",
        category: 'function',
        defaults: {
            name: {value:""}
        },
        inputs: 1,
        outputs: 1,
        icon: "inject.png",
        label: function() {
                return this.name || "example";
        }
});
</script>


<script type="text/x-red" data-template-name="example">
        <div class="form-row">
                <label for="node-input-name"><i class="fa fa-tag"></i> Name </label>
        </div>
</script>

<script type="text/x-red" data-help-name="example">
        <p>Converts msg.payload  to a lower-case string.</p>
</script>

The package.json file:

{
  "name": "node-red-contrib-example",
  "version": "1.0.0",
  "description": "",
  "author": "",
  "license": "ISC",
  "node-red": {
    "nodes": {
      "example": "exampleNode.js"
    }
  }
}


It seems to be correctly loaded by node-red (fragment of : $HOME/.node-red/.config.json):

  "node-red-contrib-example": {
   "name": "node-red-contrib-example",
   "version": "1.0.0",
   "local": true,
   "nodes": {
    "example": {
     "name": "example",
     "types": [
      "example"
     ],
     "enabled": true,
     "local": true,
     "module": "node-red-contrib-example",
     "file": "/home/maq/.node-red/node_modules/node-red-contrib-example/exampleNode.js"
    }
   }
  }
 },

Sorry I am sending a lot of data; just to show that I am considering all the possible mistakes commented here. After a number of hours trying different options, I haven't managed to put the node to work. I have to say that the node can be selected from the palette, but it cannot deploy the code as it says "Flows stopped due to missing node types."

Thanks a lot in advance

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:
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

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