Today, I started to playing with React and I could be able to implement initial SSR support for React with Flow Router.
This version does server side route isolation and user does not need to worry about managing data state for SSR. Basically, you just write your app as usually and we’ll do the hard work for you.
Hi Arunoda, my application uses quite a lot of jQuery on the client side. As such, when I try to install and run FlowRouter SSR it throws a number of errors, including ‘$ not defined’ and ‘cannot map undefined.’ My understanding is that these errors are because jQuery is not loaded/available on the server side.
Hey, you need to write in a way it can be used both in server and client. Try to use the use of jQuery with react. If needed do it in the client. componentDidMount is a good place for that.
Also another issue popping up: infrequent 502 gateways from nginx. Not sure if anyone else has reported this. Wondering if it has to do with this error:
W20151210-14:47:02.505(2)? (STDERR) Error: Cannot cache a existing cahced page: /
W20151210-14:47:02.505(2)? (STDERR) at _class._cachePage (server/route.js:164:13)
W20151210-14:47:02.505(2)? (STDERR) at ServerResponse._injectHtml.res.write (server/route.js:86:16)
W20151210-14:47:02.506(2)? (STDERR) at Object.handle (packages/webapp/webapp_server.js:717:1)
W20151210-14:47:02.506(2)? (STDERR) at next (/root/.meteor/packages/webapp/.1.2.3.1r2qb00++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:190:15)
W20151210-14:47:02.506(2)? (STDERR) at next (/root/.meteor/packages/webapp/.1.2.3.1r2qb00++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:192:9)
W20151210-14:47:02.506(2)? (STDERR) at next (/root/.meteor/packages/webapp/.1.2.3.1r2qb00++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:127:23)
W20151210-14:47:02.507(2)? (STDERR) at middleware (packages/oauth/oauth_server.js:157:1)
W20151210-14:47:02.507(2)? (STDERR) at packages/oauth/oauth_server.js:146:1