-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Error: A value was yielded that could not be treated as a promise
benjamingr edited this page Dec 21, 2014
·
2 revisions
Error: A value was yielded that could not be treated as a promise
You are getting this error because you have tried to yield something in a coroutine without a yield handler, for example:
var coroutine = Promise.coroutine(function*(){
var bar = yield "Foo";
console.log(bar);
});The solution is to either convert it to a promise by calling Promise.resolve on it or Promise.promisify if it's a callback:
var coroutine = Promise.coroutine(function*(){
var bar = yield Promise.resolve("Foo");
console.log(bar);
});Or to use .addYieldHandler to teach Promise.coroutine to accept these sort of values.
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