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: Cannot use 'in' operator to search for 'encoding' in undefined #6

Open
askie opened this issue Apr 5, 2014 · 1 comment

Comments

@askie
Copy link

askie commented Apr 5, 2014

code:

var gearman = require("gearman"),
client = gearman.createClient(4730, "my-gearman-server.example.com");

console.log("Sending job...");
var job = client.submitJob("reverse", "Hello World!", { encoding: "utf8" });
job.on("complete", function (data) {
console.log(data);
client.end();
});


sometime error bellow when do submitJob faster:

/home/jj/node_modules/gearman/lib/client/responses.js:9
if ("encoding" in job) { d = d.toString(job.encoding); }
^
TypeError: Cannot use 'in' operator to search for 'encoding' in undefined
at Object.WORK_COMPLETE (/home/jj/node_modules/gearman/lib/client/responses.js:9:27)
at Socket.Client.getConnection.connection (/home/jj/node_modules/gearman/lib/client.js:38:53)
at Socket.EventEmitter.emit (events.js:96:17)
at TCP.onread (net.js:397:14)


is that need a callback in gearman.createClient,
and using callback to submitJob a job ?

@smith
Copy link
Contributor

smith commented Apr 7, 2014

Which version of Node are you using? This project hasn't been updated in a long time (I'm no longer using it so no longer making updates) and it's possible that the latest release of this module doesn't work at all with newer releases of Node.

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

No branches or pull requests

2 participants