FormidableLabs/rapscallion

Unhandled rejection TypeError: Unknown node of type: undefined

Open

#109 创建于 2017年7月13日

在 GitHub 查看
 (1 评论) (3 反应) (0 负责人)JavaScript (1,397 star) (68 fork)batch import
bughelp wanted

描述

Hello, i am using react starter kit and trying to replace reactdom with rapscallion. butt i getting this error

Unhandled rejection TypeError: Unknown node of type: undefined
    at traverse (.......\node_modules\rapscallion\lib\render\traverse.js:373:9)
     at renderChildrenArray (\node_modules\rapscallion\lib\render\traverse.js:57:7)
    at renderChildren (\node_modules\rapscallion\lib\render\traverse.js:78:5)
    at \node_modules\rapscallion\lib\render\traverse.js:127:14
    at Sequence.pushFrame (\node_modules\rapscallion\lib\sequence\sequence.js:49:14)
    at C:\Projects\ellinairwebsite\node_modules\rapscallion\lib\sequence\sequence.js:137:30

I tried to replace a part

const html = ReactDOM.renderToStaticMarkup(<Html {...data} />);
 res.status(route.status || 200);
 res.send(`<!doctype html>${html}`);

with

const html = rapscallion.render(<Html {...data} />);
 let responseTemplate = rapscallion.template`<!doctype html>${html}`;
 responseTemplate.toStream().pipe(res);

any suggestion?

贡献者指南

Unhandled rejection TypeError: Unknown node of type: undefined · FormidableLabs/rapscallion#109 | Good First Issue