-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.1.2 provoke TypeError: Cannot read property 'length' of undefined in es6-promise #176
Comments
Facing the same issue |
for me it's related to core-js which is a transitive dependency of karma. I pinned core-js at 2.1.1 and this way it works for me. at least a quick fix. |
It's a bug in |
Reproducible example: require('es6-promise');
var p = Promise.resolve();
p.constructor = function(it){ it(function(){}, function(){})};
p.constructor[Symbol.species] = function(it){ it(function(){}, function(){})};
try {
var f = p.then(function(){});
console.log('works: ', f instanceof p.constructor[Symbol.species]);
} catch(e){
console.log('caught error');
} |
I will add a fallback for this buggy implementation, need to think how. |
In |
Thank you @zloirock for your hard work! 👍 |
Es6-promise should also no longer cause this crash |
I create an issue in Karma, but my guess is it is more relevant here.
Karma related issue : karma-runner/karma#1946
es6-promise related issue : stefanpenner/es6-promise#169
Stack trace:
This commit should have provoke the regression : 3b8292d#diff-ee864bf9a84ab105426dbe4fbbad2a69
But my knowledge of node.js is close to zero, so it's just a guess.
The stacktrace seems to lead to this particular line:
https://github.com/stefanpenner/es6-promise/blob/master/lib/es6-promise/-internal.js#L127
As both es6-promise and core-js depend on nothing, I bet that error occured when both are called from other libraries, like in my case, grunt-ts(depends on es6-promise) and karma(depends on core-js).
I also bet that one overwrites global stuff from the other, which explains why error occured when both are called from the same process, and not when they are called one task after the other on different process.
The text was updated successfully, but these errors were encountered: