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
undefined is not a function (functions must be bound by 'request'). #1506
Comments
I assume your file is |
Investigated this a bit more. It seems that request.[verb] now requires it to be bound by 'request'. This example doesn't work either: var post = require('request').post;
post('http://www.google.com', function (err, response, body) {
console.log(body);
}); output: /home/alexo/tmp/node_modules/request/index.js:65
return this(params.uri || null, params.options, params.callback)
^
TypeError: undefined is not a function
at request.(anonymous function) (/home/alexo/tmp/node_modules/request/index.js:65:16)
at Object.<anonymous> (/home/alexo/tmp/a.js:5:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3 The promisifying can be solved by doing: |
+1 for experiencing the same problem. The change seems to be introduced in #1430 |
👍 same here |
Thanks everyone for the thorough bug report. Fixed here #1515 can you give it a try? |
@simov 👍 It fixes the issue. |
Nice! I'll merge it shortly. |
This worked in v2.53.0
in v2.54.0, above code gives this error:
Any ideas what changes might've caused this?
The text was updated successfully, but these errors were encountered: