【发布时间】:2018-01-04 22:01:30
【问题描述】:
问题是原型没有定义,尽管在节点控制台中编写 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
【问题讨论】:
-
它无法读取原型属性,因为
http.IncomingMessage对象不存在。我认为在此之前某处有一个异步调用,最终http.IncomingMessage将存在,但在你试图摆弄它的那一刻,它不存在。 -
同意Will,
Cannot read property 'prototype' of undefined表示http.IncomingMessage未定义。 -
如何解决?
-
您是否忘记了需要
http模块?
标签: javascript node.js angular typescript wallaby.js