Azure Functions: Node.js: Request ~2.34.0 not working
See original GitHub issueReferring back to #226 and #223. The node module Request version 2.34.0 is not working on Azure Functions. Packages such as YQL are depending on it. Request version 2.70.0 is working correctly on Azure Functions. The below code snippet is working fine on request version 2.70.0, on version 2.34.0, however, the callback is never called.
var request = require('request');
module.exports = function (context) {
request('http://www.bing.com', function (error, response, body) {
// This callback function will never be called on version 2.34.0
if (error) {
context.log(error);
}
if (!error && response.statusCode == 200) {
context.log(body) // Show the HTML for the Bing homepage.
}
context.done();
});
};
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:20 (13 by maintainers)
Top Results From Across the Web
Azure Functions NodeJS: Https Request not working when ...
I am working with Azure Functions in NodeJS. I first wrote the function having azure funct locally on my laptop. The code worked...
Read more >Azure function, Incompatible Node.js version (v18.15.0)
In vscode, starting a debug a Azure Function and error message, Incompatible Node.js version (v18.15.0). Refer to our documentation to see ...
Read more >Release notes & updates – Azure CLI
Learn about the latest Azure Command-Line Interface (CLI) release notes and updates for both the current and beta versions of the CLI.
Read more >Azure Functions Node.js developer guide
Understand how to develop functions by using Node.js. ... Not all options are supported when running locally. To learn more, see host.json.
Read more >Upgrade to v4 of the Node.js model for Azure Functions
This article shows you how to upgrade your existing function apps running on v3 of the Node.js programming model to v4.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve done some investigating here – the specific commit to request that fixes things is here: https://github.com/request/request/commit/27dfc1177e01025da6d3b09a0fd3406b90596719.
The issue looks to be around calling
process.nextTick
from Edge. Executing this code inEdge.Func()
hangs as well:If you replace
process.nextTick
withsetImmediate
, things work. I see others reporting the same thing over at the Edge repo: https://github.com/tjanczuk/edge/issues/325. I’ll see if there’s a workaround or fix for this – otherwise, it appears that any package that usesprocess.nextTick
will hang.PR #486 works around this issue. If you want to get things working before this change is deployed to production, you can add this to the your code before you make the call to request:
process.nextTick = global.setImmediate;