Closed dschinkel closed 9 years ago
solved it by cloning and returning: yield Object.create(response);
Hi @dschinkel! Did you file this in the correct repository? koa-hbs
(this project) pretty much only has render()
which can be yielded, and I don't see that in your code.
Let me know if there's anything I can help with :smile:
crap how the hell did I get in this repo. Too many tabs open sorry. Yea it was meant for koa-co.
I ended up cloning the response and yielding that.
On Sep 3, 2015, at 11:18 AM, Joe Wilm notifications@github.com wrote:
Hi @dschinkel https://github.com/dschinkel! Did you file this in the correct repository? koa-hbs (this project) pretty much only has render() which can be yielded, and I don't see that in your code.
Let me know if there's anything I can help with
— Reply to this email directly or view it on GitHub https://github.com/jwilm/koa-hbs/issues/35#issuecomment-137500609.
I am trying to get back the response so that I can check it in my unit tests.
Once I added yield, it blew up. I'm using koa-controller as well.
error:
RangeError: Maximum call stack size exceeded at Object.objectToPromise (/node_modules/co/index.js:166:25)
Now if I change yield to yield { message: "test this" }; it's fine. So I wonder if it's because of the underlying source code of koa-controller middleware that's passing back the this koa context and when I try to yield it something funky is going on because koa-controller is probably doing other things in code.