Wallaby and prototype error

293 Views Asked by At

The thing is that prototype is not defined , although in the node console writing http.IncomingMessage.prototype does give an object as an output. Any Ideas ?

var req = Object.create(http.IncomingMessage.prototype)


Uncaught TypeError: Cannot read property 'prototype' of undefined
at http://localhost:62625/____wallaby-bundle.js?1501265946287&wallabyFileId=bundle:219253
1

There are 1 best solutions below

3
On

I think http.IncomingMessage is undefined.

It may happened http has been overridden some where in your code .

var http = require('http');
var req = Object.create(http.IncomingMessage.prototype)

I have tested the above code and it works.