gpbl/isomorphic500

TypeError: Cannot read property 'map' of undefined

juancabrera opened this issue · 5 comments

When I run npm run dev it works fine, but when I hit the URL on browser I'm getting this error (got same error on npm run built):

TypeError: Cannot read property 'map' of undefined
    at HtmlDocument.render (/Users/cabrera/htdocs/juan/isomorphic500/src/server/HtmlDocument.js:59:19)
    at [object Object].ReactCompositeComponentMixin._renderValidatedComponentWithoutOwnerOrContext (/Users/cabrera/htdocs/juan/isomorphic500/node_modules/react/lib/ReactCompositeComponent.js:789:34)
    at [object Object].ReactCompositeComponentMixin._renderValidatedComponent (/Users/cabrera/htdocs/juan/isomorphic500/node_modules/react/lib/ReactCompositeComponent.js:816:14)
    at [object Object].wrapper [as _renderValidatedComponent] (/Users/cabrera/htdocs/juan/isomorphic500/node_modules/react/lib/ReactPerf.js:70:21)
    at [object Object].ReactCompositeComponentMixin.mountComponent (/Users/cabrera/htdocs/juan/isomorphic500/node_modules/react/lib/ReactCompositeComponent.js:237:30)
    at [object Object].wrapper [as mountComponent] (/Users/cabrera/htdocs/juan/isomorphic500/node_modules/react/lib/ReactPerf.js:70:21)
    at Object.ReactReconciler.mountComponent (/Users/cabrera/htdocs/juan/isomorphic500/node_modules/react/lib/ReactReconciler.js:38:35)
    at [object Object].ReactCompositeComponentMixin.mountComponent (/Users/cabrera/htdocs/juan/isomorphic500/node_modules/react/lib/ReactCompositeComponent.js:247:34)
    at [object Object].wrapper [as mountComponent] (/Users/cabrera/htdocs/juan/isomorphic500/node_modules/react/lib/ReactPerf.js:70:21)
    at /Users/cabrera/htdocs/juan/isomorphic500/node_modules/react/lib/ReactServerRendering.js:68:32

The error is coming from here, on HtmlDocument.js:59:19

          { images.map(url => <meta property="og:image" content={ url } />) } 

I'm running node v0.12.4

gpbl commented

Yes you are right, thanks for reporting this! Let me check what went wrong ... :-)

gpbl commented

It is because this issue with babel. I just pushed an update using a previous version of babel: please pull, clean up node_modules and run npm install to get it running again :-)

git pull
rm -rf node_modules
npm install

As the issue with babel get fixed, we can move again to the latest version.

thank you so much @gpbl, works perfect now 😄

gpbl commented

It should be fixed with the last babel, however :-)

yes! tested it and all working fine.

created #74.