# TypeError: callback is not a function

**URL:** <https://discourse.nodered.org/t/typeerror-callback-is-not-a-function/44865>\
**Category:** General\
**Created:** [28 April 2021 13:55 UTC](https://discourse.nodered.org/t/typeerror-callback-is-not-a-function/44865 "2021-04-28T13:55:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lost](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@Lost](https://discourse.nodered.org/u/Lost)\
**Post date:** [28 April 2021 13:55 UTC](https://discourse.nodered.org/t/typeerror-callback-is-not-a-function/44865/1 "2021-04-28T13:55:23Z")

</div>

Hi.

Hope someone can explain why i get the error: TypeError: callback is not a function

I have been using an old openhab installation on a RSPI3 where i used nodered (v0.19.5) as the gateway between openhab and "HDL Buspro" which is my electrical smarthome system. Pallet used is: node-red-contrib-buspro (1.3.0)

This has been working great and simple example of dimming a light below.

 ![Old setup working](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7d1286cf908b3854923120540b71f88806613f61.jpeg)

```auto
[{"id":"ca154ae3.e123e8","type":"buspro-out","z":"6195a12f.c1d05","controller":"fae2d339.0fb5","name":"","x":550,"y":120,"wires":[]},{"id":"767bf018.87b9e","type":"function","z":"6195a12f.c1d05","name":"61.2","func":"msg.target = \"1.61\"\nmsg.code = 49,\nmsg.payload = {\n channel: 2,\n level: msg.payload\n } \nreturn msg;","outputs":1,"noerr":0,"x":350,"y":120,"wires":[["ca154ae3.e123e8","60d3b32f.205fac"]]},{"id":"3caeab02.43f104","type":"inject","z":"6195a12f.c1d05","name":"","topic":"","payload":"100","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":120,"wires":[["767bf018.87b9e"]]},{"id":"2710e2dc.64286e","type":"inject","z":"6195a12f.c1d05","name":"","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":170,"y":220,"wires":[["767bf018.87b9e"]]},{"id":"1acdeca7.1704a3","type":"comment","z":"6195a12f.c1d05","name":"Dim to 100%","info":"","x":130,"y":80,"wires":[]},{"id":"fd4161a0.1b962","type":"comment","z":"6195a12f.c1d05","name":"Dim to 0%","info":"","x":120,"y":180,"wires":[]},{"id":"60d3b32f.205fac","type":"debug","z":"6195a12f.c1d05","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":530,"y":220,"wires":[]},{"id":"fae2d339.0fb5","type":"buspro-controller","z":"","host":"192.168.10.250","port":"6000","subnetid":"1","deviceid":"99"}]

```

HDL equipment is all connected on a bus and i have to send adress for dimmer witch is 1.61, code for dimming a light witch is 49. and light channel on dimmer and new level for light in the payload.

Wanted to change to Home assistant and use nodered as the gateway like before as HDL is not supported.  
Installed home assistant (v 2021.4.6) and nodered (v1.3.3) on a new RSPI3. with the same pallet: node-red-contrib-buspro (1.3.0)

I am able to read all the bus traffic and status updates etc. like before but i can no longer send anything to the bus as i get the error.

By using the same example i now get the error: "TypeError: callback is not a function"

 ![New setup not working](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f9212eb19bbf648f9addd7194b1117b245bf4b86.jpeg)

Do i have to change the formating in the function node or is it the pallet that has been broken due to new nodered version?

Many thanks in advance!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 April 2021 15:22 UTC](https://discourse.nodered.org/t/typeerror-callback-is-not-a-function/44865/2 "2021-04-28T15:22:02Z")

</div>

Which node is generating the error? It does not seem to be one in the flow you posted. Click on the node id above the error and it should take you there.

---

<div class="post-metadata">

**Author:** ![Lost](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@Lost](https://discourse.nodered.org/u/Lost)\
**Post date:** [28 April 2021 15:50 UTC](https://discourse.nodered.org/t/typeerror-callback-is-not-a-function/44865/3 "2021-04-28T15:50:34Z")

</div>

The error is generated by the BusPro node. This is also the only flow installed atm.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 April 2021 20:27 UTC](https://discourse.nodered.org/t/typeerror-callback-is-not-a-function/44865/4 "2021-04-28T20:27:47Z")

</div>

> [@Lost](#):
>
> The error is generated by the BusPro node

Are you sure? The node id in the debug pane above the image appears to start with ecd7 and there is not a node with that id in the flow you pasted.

If it is from that node then I think you may be better asking by raising an issue on the github page for the node. I see it has not been updated for two years so it may be that it is not compatible with the current version of nodejs, or it may be something else. Which version of nodejs are you using? You can get that by running  
`node -v`  
in a terminal.

---

<div class="post-metadata">

**Author:** ![Lost](https://avatars.discourse-cdn.com/v4/letter/l/22d042/32.png) [@Lost](https://discourse.nodered.org/u/Lost)\
**Post date:** [28 April 2021 21:23 UTC](https://discourse.nodered.org/t/typeerror-callback-is-not-a-function/44865/5 "2021-04-28T21:23:28Z")

</div>

Thanks for the reply.

> [@Colin](#):
>
> Are you sure?

No not really but when i click it it flashes red. Not sure why the id was not the same but did a fresh paste from the forum and got the same result.

 ![Fault node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/a/7a717a34a60ee1e566aafde790346d65ae0420db.png)  
Ok will try to raise an issue on the github page.

> [@Colin](#):
>
> Which version of nodejs are you using?

Not sure as i get error message when trying from the terminal:

 ![terminal message](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/2/b2d0c870251dd8ee87f615c53099ecb8d2740ef8.jpeg)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [29 April 2021 08:46 UTC](https://discourse.nodered.org/t/typeerror-callback-is-not-a-function/44865/6 "2021-04-29T08:46:52Z")

</div>

Oh yes, HA runs node red in a Container doesn't it, so you would have to look in the container. I don't use HA (not many here do) so can't help with that. Most here use node-red to do everything rather than using HA.

---

<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:** [28 June 2021 08:47 UTC](https://discourse.nodered.org/t/typeerror-callback-is-not-a-function/44865/7 "2021-06-28T08:47:29Z")

</div>

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