Skip to content
This repository has been archived by the owner on Nov 17, 2017. It is now read-only.

TypeError: Cannot read property 'map' of undefined #73

Closed
juancabrera opened this issue Jul 27, 2015 · 5 comments
Closed

TypeError: Cannot read property 'map' of undefined #73

juancabrera opened this issue Jul 27, 2015 · 5 comments

Comments

@juancabrera
Copy link
Contributor

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
Copy link
Owner

gpbl commented Jul 27, 2015

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

gpbl added a commit that referenced this issue Jul 27, 2015
@gpbl
Copy link
Owner

gpbl commented Jul 27, 2015

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.

@juancabrera
Copy link
Contributor Author

thank you so much @gpbl, works perfect now 😄

@gpbl
Copy link
Owner

gpbl commented Jul 28, 2015

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

@juancabrera
Copy link
Contributor Author

yes! tested it and all working fine.

created #74.

@gpbl gpbl closed this as completed Jul 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants