-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Error: Illegal resolve reject invocation
ERROR: Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.
This happens when using the deprecated old defer() api but calling the resolve and reject function not as a method - for example:
var d = Promise.defer();
d.resolve(); // this is fine
var copy = resolve;
resolve(); // Throws the above error, use `function(){ d.resolve(); }` instead.
This might happen when doing something like:
myCallBackAPI("param", d.resolve);
In which case consider using the promise constructor that doesn't have this problem, using Function.prototype.bind or using automatic promisification if applicable.
What sorcery is this?!
so just dont wwrite cryptic ancient js that nobody knows because turbo doesnt know eitherhttps://github.com/petkaantonov/bluebird.wiki.git
lol ancient Q JS circa 2012 being called up randoml to make a circular logic loom promise that, surprisingly, does not reject itself when it calls itself!
- Dr Q, the other ancient Q https//github.com/drqedwards/ppm