Closed lukeapage closed 7 years ago
Sorry.. all attempts I've made at a cutdown reproducible have failed, but maybe you can think of something that might help?
Thanks for your report, I'll look into it.
Have you read this, maybe it helps : https://github.com/ysmood/yaku/blob/master/docs/debugHelperComparison.md
Yes, but the problem is an unhandled rejection (or 2 actually for the same promise chain) that I do not expect to see. If switching to throw hadn't solved it I would have investigated more.
var Promise = Yaku = require("yaku");
var promise = Yaku.reject()
promise.catch(() => {
return Promise.reject();
}).catch(() => {
});
For me the code above works without any problem. So the question is still how to reproduce your issue.
Yep and I've tried more complicated cases. I think I'll have to experiment/investigate.
I'm wondering if one of the promises on my chain is using the native promise and thats why. I'll add alot of debugging and get back to you.
In most cases, you just forgot to write a return
.
Or you can add a line before everything to wipe out native Promise noise:
var Promise = require("yaku");
// browser
window.Promise = Promise
// node.js
global.Promise = Promise
I can track down further if its not obvious but I've been trying to work out why I get unhandled rejections for promises that are handled. I've not been able to make a reduced test case, but the behaviour seems to occur when I have something like
and it appears changing the return to throw make it work and not give unhandled rejections (which is the expected behaviour).