# Flows stopped due to missing node types (but node type is undefined)

**URL:** <https://discourse.nodered.org/t/flows-stopped-due-to-missing-node-types-but-node-type-is-undefined/80114>\
**Category:** Developing Nodes\
**Created:** [27 July 2023 13:03 UTC](https://discourse.nodered.org/t/flows-stopped-due-to-missing-node-types-but-node-type-is-undefined/80114 "2023-07-27T13:03:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mngkkkkkk](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mngkkkkkk](https://discourse.nodered.org/u/mngkkkkkk)\
**Post date:** [27 July 2023 13:03 UTC](https://discourse.nodered.org/t/flows-stopped-due-to-missing-node-types-but-node-type-is-undefined/80114/1 "2023-07-27T13:03:38Z")

</div>

Hi everyone, I'm new to node-red and java script in general  
And I want to create my node that will take data, do some manipulations with this data and then send the data via http I use axios for requests  
After many attempts I managed to install my node.  
but now I hit a wall and I don't know what to do.  
When I try to deploy I get an error Flows stopped due to missing node types but the thing is it doesn't say what nodes are missing instead it just blanks the field.  
In the node itself I don't have the gui for node configuration displayed  
I'm trying to figure out what the problem is either in my code or in the nodejs settings.

I would be grateful for your help  
Thanks in advance to all who helped

my js code:

```auto
const axios = require("axios");

module.exports = function (RED) {
    function SimpleBuNode(config) {
        RED.nodes.createNode(this, config);

        // Retrieve node properties from the config
        this.endpointUrl = config.endpointUrl;
        this.sn = config.sn;
        this.type = config.type;
        this.isProd = config.isProd;

        // Function to handle the input messages
        this.on("input", function (msg, send, done) {
            // Check if the input is an array of objects or a single object
            const payload = Array.isArray(msg.payload) ? msg.payload : [msg.payload];

            // Prepare the data for the HTTP request
            const data = payload.map((obj) => ({
                timestamp: obj.timestamp,
                sensor: obj.sensor,
                value: obj.value,
            }));

            // Create the request payload
            const requestData = {
                dzType: this.type,
                dzSN: this.sn,
                data: data,
                isProd: this.isProd,
            };

            // Make the HTTP POST request using Axios
            axios
                .post(this.endpointUrl, requestData)
                .then((response) => {
                    // Do something with the response if needed
                    // For example, log the response
                    this.log("Received response: " + JSON.stringify(response.data));

                    // Send the output message with the response data
                    msg.payload = response.data;
                    send(msg);
                    done();
                })
                .catch((error) => {
                    // Handle the error if the request fails
                    this.error("Failed to make HTTP request: " + error.message);
                    done(error);
                });
        });
    }

    RED.nodes.registerType("simple-bu", SimpleBuNode);
};

```

my html code:

```auto
<script type="text/javascript">
    // Define the configuration panel
    RED.nodes.registerType('simple-bu', {
      category: 'config',
      color: '#a6bbcf',
      defaults: {
        endpointUrl: { value: "", required: true },
        sn: { value: "", required: true },
        type: { value: "", required: true },
        mode: { value: "test", required: true },
      },
      inputs: 1,
      outputs: 1,
      icon: "node-red-contrib-simple-bu.png",
      label: function () {
        return this.name || 'simple-bu';
      },
      oneditprepare: function () {
        $("#node-input-mode").on("change", function () {
          if (this.value === "test") {
            $("#node-simple-bu-endpointUrl-row").show();
            $("#node-simple-bu-sn-row").show();
            $("#node-simple-bu-type-row").show();
          } else {
            $("#node-simple-bu-endpointUrl-row").hide();
            $("#node-simple-bu-sn-row").hide();
            $("#node-simple-bu-type-row").hide();
          }
        });
      },
      oneditsave: function () {
        var mode = $("#node-input-mode").val();
        if (mode === "prod") {
          // Clear fields for prod mode to avoid sending sensitive data
          $("#node-input-endpointUrl").val("");
          $("#node-input-sn").val("");
          $("#node-input-type").val("");
        }
      },
    });
  </script>
  <style>
    /* Add any custom CSS styles for the configuration panel here */
    /* For example, to hide rows based on the mode */
    #node-simple-bu-endpointUrl-row,
    #node-simple-bu-sn-row,
    #node-simple-bu-type-row {
      display: none;
    }
  </style>
  <div class="form-row">
    <label for="node-input-mode"><i class="icon-tag"></i> Mode</label>
    <select id="node-input-mode">
      <option value="test" selected>Test</option>
      <option value="prod">Prod</option>
    </select>
  </div>
  <div class="form-row" id="node-simple-bu-endpointUrl-row">
    <label for="node-input-endpointUrl"><i class="icon-link"></i> Endpoint URL</label>
    <input type="text" id="node-input-endpointUrl" placeholder="Endpoint URL">
  </div>
  <div class="form-row" id="node-simple-bu-sn-row">
    <label for="node-input-sn"><i class="icon-tag"></i> SN</label>
    <input type="text" id="node-input-sn" placeholder="SN">
  </div>
  <div class="form-row" id="node-simple-bu-type-row">
    <label for="node-input-type"><i class="icon-tag"></i> Type</label>
    <input type="text" id="node-input-type" placeholder="Type">
  </div>
  

```

 ![Screenshot 2023-07-27 132516](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/c/1caca1062ffe4d215917c48d9ef8061923048750.png)

---

<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 July 2023 13:19 UTC](https://discourse.nodered.org/t/flows-stopped-due-to-missing-node-types-but-node-type-is-undefined/80114/2 "2023-07-27T13:19:43Z")

</div>

Hello @mngkkkkkk!  
Welcome to this community!

> [@mngkkkkkk](#):
>
> I'm trying to figure out what the problem is either in my code or in the nodejs settings.

Most probably you've an error in either the server side or the client side code of your (custom) node.  
Just check the console of your browser or the console output of the NR server if there're some issues reported.

---

<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:** [27 July 2023 15:50 UTC](https://discourse.nodered.org/t/flows-stopped-due-to-missing-node-types-but-node-type-is-undefined/80114/3 "2023-07-27T15:50:29Z")

</div>

> [@mngkkkkkk](#):
>
> my html code:

If that really is your code, you are missing important parts - like `<script type="text/html" data-template-name="node-type">` for your form elements

Its listed in the [docs](https://nodered.org/docs/creating-nodes/node-html) and there are around 4500 nodes on NPM you can look at for inspiration.

Good luck 🤞

---

<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:** [25 September 2023 15:50 UTC](https://discourse.nodered.org/t/flows-stopped-due-to-missing-node-types-but-node-type-is-undefined/80114/4 "2023-09-25T15:50:37Z")

</div>

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