Error when doing SSR. path:/: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at app/components/post_list.jsx:11:12
at Array.map (/home/neopostmodern/.meteor/packages/es5-shim/.4.5.10.jjty9l++os+web.browser+web.cordova/npm/node_modules/es5-shim/es5-shim.js:466:33)
at new PostList (app/components/post_list.jsx:7:14)
at [object Object].ReactCompositeComponentMixin.mountComponent (/home/neopostmodern/Code/meteor-data-and-react/node_modules/react/lib/ReactCompositeComponent.js:148:18)
at [object Object].wrapper [as mountComponent] (/home/neopostmodern/Code/meteor-data-and-react/node_modules/react/lib/ReactPerf.js:66:21)
at Object.ReactReconciler.mountComponent (/home/neopostmodern/Code/meteor-data-and-react/node_modules/react/lib/ReactReconciler.js:37:35)
at [object Object].ReactCompositeComponentMixin.mountComponent (/home/neopostmodern/Code/meteor-data-and-react/node_modules/react/lib/ReactCompositeComponent.js:225:34)
at [object Object].wrapper [as mountComponent] (/home/neopostmodern/Code/meteor-data-and-react/node_modules/react/lib/ReactPerf.js:66:21)
at Object.ReactReconciler.mountComponent (/home/neopostmodern/Code/meteor-data-and-react/node_modules/react/lib/ReactReconciler.js:37:35)
at ReactDOMComponent.ReactMultiChild.Mixin.mountChildren (/home/neopostmodern/Code/meteor-data-and-react/node_modules/react/lib/ReactMultiChild.js:241:44)
Apparently the transform function doesn't get called.
Repo for reproduction: https://github.com/neopostmodern/meteor-data-and-react
I simply added a
transform
:And used the field in a component:
Works as expected in browser but fails on server:
Apparently the
transform
function doesn't get called.Probably related to https://github.com/kadirahq/flow-router/issues/592, but my case also applies if not using any external packages but the native transform.