Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

promise-based rendering. sometimes hangs #103

Open
indeyets opened this issue Jun 30, 2017 · 9 comments
Open

promise-based rendering. sometimes hangs #103

indeyets opened this issue Jun 30, 2017 · 9 comments
Labels

Comments

@indeyets
Copy link

indeyets commented Jun 30, 2017

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

@indeyets
Copy link
Author

@fleg any ideas what could cause this? error handling maybe?

@indeyets
Copy link
Author

indeyets commented Jun 30, 2017

ok, it actually returns, but it takes several minutes. The server is in a blocked state during this period.

@indeyets
Copy link
Author

figured out the trigger. it's NODE_ENV=development. it works fine with other values

@88kami88
Copy link
Contributor

This is new in >= 2.1.8?

@indeyets
Copy link
Author

Yup. I didn't see it happening before. Might be coincidence of course. I will recheck with older version later today

@88kami88
Copy link
Contributor

88kami88 commented Jul 3, 2017

I think it's possible #106 would manifest this way for promises.

@liviuignat
Copy link

liviuignat commented Jul 12, 2017

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?

@88kami88
Copy link
Contributor

88kami88 commented Aug 2, 2017

@indeyets Is this fixed in 2.1.13 by chance?

@88kami88 88kami88 added the bug label Aug 2, 2017
@indeyets
Copy link
Author

indeyets commented Aug 2, 2017

@ethersage it isn't. still happens here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants