NoFlo instance.isReady不是一个函数

时间:2017-08-10 13:34:00

标签: node.js noflo

以下是flow.json

{
  "id": "04211388-4ea7-4999-9fd1-3b793283fcbf",
  "user": "******",
  "host": "autodetect",
  "port": 3569,
  "label": "my-runtime",
  "secret": "***",
  "permissions": {
    "***": [
      "protocol:component",
      "protocol:runtime",
      "protocol:graph",
      "protocol:network",
      "component:getsource",
      "component:setsource"
    ]
  },
    "properties": {
      "name": "HTTP GET Client Demo",
      "id": "04211388-4ea7-4999-9fd1-***",
      "user": "af4e9e59-539b-4ea0-b683-***",
      "environment": {
        "type": "noflo-nodejs"
      }
    },
    "inports": {},
    "outports": {},
    "groups": [],
    "processes": {
      "SendRequest": {
        "component": "http/SendRequest",
        "metadata": {
          "label": "SendRequest",
          "x": 360,
          "y": 216,
          "width": 72,
          "height": 72
        }
      },
      "ReceiveResponse": {
        "component": "http/ReceiveResponse",
        "metadata": {
          "label": "ReceiveResponse",
          "x": 504,
          "y": 216,
          "width": 72,
          "height": 72
        }
      },
      "core/Repeat_2iq0o": {
        "component": "core/Repeat",
        "metadata": {
          "label": "core/Repeat",
          "x": 216,
          "y": 216,
          "width": 72,
          "height": 72
        }
      },
      "core/Output_av11k": {
        "component": "core/Output",
        "metadata": {
          "label": "core/Output",
          "x": 648,
          "y": 216,
          "width": 72,
          "height": 72
        }
      }
    },
    "connections": [
      {
        "src": {
          "process": "core/Repeat_2iq0o",
          "port": "out"
        },
        "tgt": {
          "process": "SendRequest",
          "port": "url"
        },
        "metadata": {
          "route": 4
        }
      },
      {
        "src": {
          "process": "core/Repeat_2iq0o",
          "port": "out"
        },
        "tgt": {
          "process": "SendRequest",
          "port": "start"
        },
        "metadata": {
          "route": 3
        }
      },
      {
        "src": {
          "process": "SendRequest",
          "port": "request"
        },
        "tgt": {
          "process": "ReceiveResponse",
          "port": "request"
        },
        "metadata": {
          "route": 4
        }
      },
      {
        "src": {
          "process": "ReceiveResponse",
          "port": "enter code here message"
        },
        "tgt"`enter code here`: {
          "process": "core/Output_av11k",
          "port": "in"`enter code here`
        },
        "metadata": {
          "route": 7
        }
      },
      {
        "data": "https://httpbin.org/get",
        "tgt": {
          "process": "core/Repeat_2iq0o",
          "port": "in"
        }
      }
    ]
}

以下是错误代码

<pre>
TypeError: instance.isReady is not a function
  at /home/atif/WorkSpace/NoFLowProjects/noflo/node_modules/noflo-runtime-base/protocol/Component.js:133:25
  at /home/atif/WorkSpace/NoFLowProjects/noflo/node_modules/noflo/lib/ComponentLoader.js:133:18
  at Object.exports.dynamicLoad (/home/atif/WorkSpace/NoFLowProjects/noflo/node_modules/noflo/lib/loader/NodeJs.js:197:12)
  at ComponentLoader.createComponent (/home/atif/WorkSpace/NoFLowProjects/noflo/node_modules/noflo/lib/ComponentLoader.js:146:26)
  at ComponentLoader.load (/home/atif/WorkSpace/NoFLowProjects/noflo/node_modules/noflo/lib/ComponentLoader.js:117:19)
  at ComponentProtocol.processComponent (/home/atif/WorkSpace/NoFLowProjects/noflo/node_modules/noflo-runtime-base/protocol/Component.js:124:21)
  at /home/atif/WorkSpace/NoFLowProjects/noflo/node_modules/noflo-runtime-base/protocol/Component.js:66:26
  at Array.forEach (native)`enter code here`

</pre>

1 个答案:

答案 0 :(得分:0)

这听起来像你要加载的组件没有返回有效的组件实例(使用noflo.Component基类)。

如果您的图表只包含http/SendRequest,那么该组件的实现可能就是问题。

查看noflo-http,依赖于一个非常古老的NoFlo版本是硬编码的,所以可能需要更新。