react-starter-kit: TypeError: Cannot read property 'map' of null

I got this error when I run "npm start " after npm install

Warning: Failed propType: Required prop news was not specified in Home. Check the render method of WithStyles(Home). TypeError: Cannot read property ‘map’ of null

  • Home.js:20 new Home /Users/hongpf/hosken5/reacttest/build/webpack:/src/routes/home/Home.js:20:12
  • ReactCompositeComponent.js:148 [object Object].ReactCompositeComponentMixin. mountComponent [reacttest]/[react]/lib/ReactCompositeComponent.js:148:18
  • ReactPerf.js:66 [object Object].wrapper [as mountComponent] [reacttest]/[react]/lib/ReactPerf.js:66:21
  • ReactReconciler.js:37 Object.ReactReconciler.mountComponent [reacttest]/[react]/lib/ReactReconciler.js:37:35
  • ReactCompositeComponent.js:225 [object Object].ReactCompositeComponentMixin. mountComponent [reacttest]/[react]/lib/ReactCompositeComponent.js:225:34
  • ReactPerf.js:66 [object Object].wrapper [as mountComponent] [reacttest]/[react]/lib/ReactPerf.js:66:21
  • ReactReconciler.js:37 Object.ReactReconciler.mountComponent [reacttest]/[react]/lib/ReactReconciler.js:37:35
  • ReactMultiChild.js:241 ReactDOMComponent.ReactMultiChild.Mixin.mountChildren [reacttest]/[react]/lib/ReactMultiChild.js:241:44
  • ReactDOMComponent.js:591 ReactDOMComponent.Mixin._createContentMarkup [reacttest]/[react]/lib/ReactDOMComponent.js:591:32
  • ReactDOMComponent.js:479 ReactDOMComponent.Mixin.mountComponent [reacttest]/[react]/lib/ReactDOMComponent.js:479:29
  • ReactReconciler.js:37 Object.ReactReconciler.mountComponent [reacttest]/[react]/lib/ReactReconciler.js:37:35
  • ReactCompositeComponent.js:225 [object Object].ReactCompositeComponentMixin. mountComponent [reacttest]/[react]/lib/ReactCompositeComponent.js:225:34
  • ReactPerf.js:66 [object Object].wrapper [as mountComponent] [reacttest]/[react]/lib/ReactPerf.js:66:21
  • ReactServerRendering.js:42 [reacttest]/[react]/lib/ReactServerRendering.js:42:38
  • Transaction.js:136 ReactServerRenderingTransaction.Mixin.perform [reacttest]/[react]/lib/Transaction.js:136:20
  • ReactServerRendering.js:40 Object.renderToString [reacttest]/[react]/lib/ReactServerRendering.js:40:24

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

@ritsuyan @Amorites 其实是GFW的锅(哭笑),如果和我这边一样的话。不想看下面一段的话,直接给cmd做个代理就成了。不过,都是些和开发无关的reactjs的新闻,建议直接在地址栏访问自己的内容,e.g.localhost:3001/about

I have just met this problem.

  1. Try to delete {news.map((item.....))} in Home.js, if no error happen again, restore change and continue following.
  2. Browse localhost:3001/graphql?query={news{title,link,contentSnippet}}(you could find it in index.js within same directory.
  3. More clear error infos show in the Graphiql’s right panel, maybe such as: { "data": { "news": null }, "errors": [ { "message": "request to http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&q=https://reactjsnews.com/feed.xml failed, reason: connect ETIMEDOUT 216.58.197.106:80", "locations": [ { "line": 2, "column": 3 } ] } ] }
  4. If your errors like mine that is connect etimeout, my solution is by shadowsocks and proxifer two softwores
  5. Redo 2. (do without restarting server

I got lots of data finally and everything looks good, hope you too.