Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Callback has to be a Function (azure-iothub@ > 1.7.4) #416

Closed
beneuto opened this issue Nov 1, 2018 · 8 comments
Closed

TypeError: Callback has to be a Function (azure-iothub@ > 1.7.4) #416

beneuto opened this issue Nov 1, 2018 · 8 comments

Comments

@beneuto
Copy link

beneuto commented Nov 1, 2018

Code working fine using azure-iothub v1.7.4 but breaks in v1.7.5 and above with the error: TypeError: Callback has to be a Function.

Similar problem with azure-iot-device.

Minimal code example:

var connectionString = 'HostName=myhub.azure-devices.net;SharedAccessKeyName=test;SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxx';

var device =  {   deviceId: "xyz"   };
 
var registry = iothub.Registry.fromConnectionString(connectionString);

registry.get(device.deviceId, function(err, deviceInfo, res) {    });
@anthonyvercolano
Copy link
Contributor

I'm at a bit of a loss. I've taken the above supplied code. Used my own device id and hub connection string and ran it on a 1.7.5 installation. It worked fine.

@beneuto
Copy link
Author

beneuto commented Nov 1, 2018

It may be because I am running through node-red function node?

Node-RED version: v0.19.4
Node.js version: v8.11.1

@anthonyvercolano
Copy link
Contributor

Likely. Will be discussing this with others who might have ideas.

@anthonyvercolano
Copy link
Contributor

Which node-red module are you using?

@beneuto
Copy link
Author

beneuto commented Nov 9, 2018

The Function node.

Note that the Azure IoT Hub node works fine at the latest version.

@anthonyvercolano
Copy link
Contributor

Thank you. Repro'd and investigating further.

anthonyvercolano added a commit that referenced this issue Nov 10, 2018
(fix) Issue #416. Use typeof rather than instanceof Function.
@anthonyvercolano
Copy link
Contributor

Should be available in the next release.

@az-iot-builder-01
Copy link
Collaborator

@beneuto, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants