promise-based rendering. sometimes hangs
I use promise based rendering in a project. Server is build using webpack
Sometimes, while in development mode, I see that rapscallion's promise just never returns. It usually happens when code was just recently build and nodemon started the process. Killing server and starting it manually (without auto-rebuild) usually solves the issue.
I didn't notice this behavior before the update of rapscallion. I see it all the time in my dev-cycle right now (Production env works just fine, but it runs on pre-built code).
UPDATE: figured out the trigger. NODE_ENV=development causes the hang
@fleg any ideas what could cause this? error handling maybe?
ok, it actually returns, but it takes several minutes. The server is in a blocked state during this period.
figured out the trigger. it's NODE_ENV=development. it works fine with other values
This is new in >= 2.1.8?
Yup. I didn't see it happening before. Might be coincidence of course. I will recheck with older version later today
I think it's possible #106 would manifest this way for promises.
Hi guys, Maybe it's related, but the bellow code give this warning:
(node:25231) Warning: a promise was created in a handler at node_modules/rapscallion/lib/consumers/node-stream.js:42:9 but was not returned from it, see http://goo.gl/rRqMUw
[1] at Function.Promise.cast (/node_modules/rapscallion/node_modules/bluebird/js/release/promise.js:196:13)
code:
export async function getMainComponentStream(MainComponent: any): any {
const componentRenderer = await render(MainComponent);
const templateRenderer = await template`<!doctype html>${componentRenderer}`;
const componentStream = await templateRenderer.toStream();
return componentStream;
}
Any ideas?
@indeyets Is this fixed in 2.1.13 by chance?
@ethersage it isn't. still happens here