问题是prototype没有定义,尽管在节点控制台中编写http.IncomingMessage.prototype确实会给出一个对象作为输出。有什么想法吗?
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发布于 2017-08-07 20:09:53
我认为http.IncomingMessage是未定义的。
这可能发生在你代码中的某个地方http被覆盖了。
var http = require('http');
var req = Object.create(http.IncomingMessage.prototype)我已经测试了上面的代码,它可以工作。
https://stackoverflow.com/questions/45380173
复制相似问题