Open robbieferrero opened 9 years ago
This is due to issue 3718 of the v8 project: https://code.google.com/p/v8/issues/detail?id=3718
The problem occurs when call_site.receiver
is undefined
or null
, i.e. it does have a constructor.
var frame = Object.create(call_site)
if ( typeof call_site.receiver === 'undefined' || call_site.receiver === null ) {
call_site.receiver = {};
}
frame.type = frame.getTypeName()
Technically this issue should be resolved upstream; any work done in traceback would be a bandaid. I'd prefer the bandaid over waiting on another node.js maintenance release.
The issue is not isolated to io.js (I wasn't using io.js).
I think I have the same error.
c:\wamp\www\Ayolan\Translation\node_modules\mongoose\node_modules\mpromise\lib\promise.js:108
if (this.ended && !this.hasRejectListeners()) throw reason;
^
TypeError: Cannot read property 'constructor' of undefined
at CallSiteGetTypeName (native)
at Object.make_easy [as make] (c:\wamp\www\Ayolan\Translation\node_modules\traceback\lib\frame.js:25:27)
at c:\wamp\www\Ayolan\Translation\node_modules\traceback\traceback.js:38:54
It seem to fail on frame.type = frame.getTypeName()
in frame.js:25.
If I understand correctly, this is a bug from node.js itself? So we need to wait for a fix from node?
@Vadorequest that is the same error, you are correct. The bug is from v8, we need to wait for a fix from v8, and then node.js to update their bundled v8 version. Again, there is still the workaround mentioned in previous.
I added the patch to lib/frame.js but it still throws same error
function make_easy(call_site) {
var frame = Object.create(call_site)
if( typeof call_site.receiver === 'undefined' || call_site.receiver === null ) {
call_site.receiver = {};
}
frame.this = frame.getThis()
frame.type = frame.getTypeName()
node_modules/traceback/lib/frame.js:30
frame.type = frame.getTypeName()
^
TypeError: Cannot read property 'constructor' of undefined
at CallSiteGetTypeName (native)
I am using iojs.
Any news on this? Does the situation has changed?
It seems like the issue has been fixed, i have not checked since. What version of node aren't /are safe to be used?
Getting the same error on node 5.1.1.
Tests do not pass with node 4.2.6 (LTS) and 5.x, stable.
I tried with the fork at: https://github.com/iriscouch/traceback/pull/2 and I get the error: