I have this problem with node.js, I'm using the node --trace-sync-io when starting my application and when I make api call on my server.js file using the request module and request-promise module, it still warns that I'm using Sync API and points to the start of my request.promise call.
var request = require("request");
var rp = require("request-promise");
var options = {
uri: url,
json: true
};
rp(options).then(function (data){
//then I do something with data here
}.catch(function(err){
//catch errors here
})
So when I start node with command node --trace-sync-io server.js
I get WARNING: Detected use of sync API
and stack trace
(node:17212) WARNING: Detected use of sync API
at rng (mypath\node_modules\uuid\lib\rng.js:7:10)
at v4 (mypath\node_modules\uuid\v4.js:13:52)
at Multipart (mypath\node_modules\request\lib\multipart.js:11:19)
at Request (mypath\node_modules\request\request.js:127:21)
at request (mypath\node_modules\request\index.js:54:10)
at mypath\server.js:333:8
at emitOne (events.js:96:13)
at emit (events.js:188:7)
at Query.handleReadyForQuery (mypath\node_modules\pg\lib\query.js:126:8)
which points to the line where I start the call rp(options.then(function(data)))