You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError: Cannot read property '_handle' of undefined
at Server.listen (net.js:1383:12)
at internal/util.js:277:30
at new Promise (<anonymous>)
at internal/util.js:276:12
at start (/home/simone/Desktop/util-promisify.js:8:11)
at Object.<anonymous> (/home/simone/Desktop/util-promisify.js:15:1)
at Module._compile (internal/modules/cjs/loader.js:945:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:962:10)
at Module.load (internal/modules/cjs/loader.js:798:32)
at Function.Module._load (internal/modules/cjs/loader.js:711:12)
because in net.js:1383 there is
if(this._handle){
while util.promisify do
original.call(this, ...args,(err, ...values)=>{
so this at execution of listen function is no more its own instance, but a new context.
Reading the documentation, this is not reported, so I'm opening this issue - that I suppose to be a bug.
In my opinion, a possible solution could be adding an optional arg instance to util.promisify, like
util.promisify(original,[instance])
then, after checked that instance is an object and instance[original] exists, could be
Hi all
I'm having an issue with
util.promisify, trying to apply it to an object method, as followoutput is
because in
net.js:1383there iswhile
util.promisifydoso
thisat execution oflistenfunction is no more its own instance, but a new context.Reading the documentation, this is not reported, so I'm opening this issue - that I suppose to be a bug.
In my opinion, a possible solution could be adding an optional arg
instancetoutil.promisify, likethen, after checked that instance is an object and
instance[original]exists, could beit could be called as
and works as aspected.
If you agree with this solution, I'd be glad to do that.