{"action":"created","issue":{"url":"https://api.github.com/repos/antonybudianto/cra-universal/issues/10","repository_url":"https://api.github.com/repos/antonybudianto/cra-universal","labels_url":"https://api.github.com/repos/antonybudianto/cra-universal/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/antonybudianto/cra-universal/issues/10/comments","events_url":"https://api.github.com/repos/antonybudianto/cra-universal/issues/10/events","html_url":"https://github.com/antonybudianto/cra-universal/issues/10","id":269010985,"number":10,"title":"Error with Redux connect","user":{"login":"usefksa","id":2154387,"avatar_url":"https://avatars1.githubusercontent.com/u/2154387?v=4","gravatar_id":"","url":"https://api.github.com/users/usefksa","html_url":"https://github.com/usefksa","followers_url":"https://api.github.com/users/usefksa/followers","following_url":"https://api.github.com/users/usefksa/following{/other_user}","gists_url":"https://api.github.com/users/usefksa/gists{/gist_id}","starred_url":"https://api.github.com/users/usefksa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usefksa/subscriptions","organizations_url":"https://api.github.com/users/usefksa/orgs","repos_url":"https://api.github.com/users/usefksa/repos","events_url":"https://api.github.com/users/usefksa/events{/privacy}","received_events_url":"https://api.github.com/users/usefksa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-10-27T07:20:59Z","updated_at":"2017-10-27T14:31:12Z","closed_at":null,"author_association":"NONE","body":"I am trying to use cra-universal in my project but I am getting this error on server side :\r\n`Invariant Violation: Could not find \"store\" in either the context or props of \"Connect(App)\". Either wrap the root component in a <Provider>, or explicitly pass \"store\" as a prop to \"Connect(App)\".`\r\n\r\n\r\nMy code looks like this\r\n```\r\nexport class App extends Component {\r\n\r\nrender() {\r\n//code here\r\n}\r\n}\r\nfunction mapStateToProps(state) {\r\n//code here\r\n}\r\n\r\nexport default connect(mapStateToProps)(App);\r\n\r\n```\r\n\r\nMy code is working fine on the browser. \r\nHow I can fix this issue?\r\n\r\n\r\nThanks\r\n"},"comment":{"url":"https://api.github.com/repos/antonybudianto/cra-universal/issues/comments/339988213","html_url":"https://github.com/antonybudianto/cra-universal/issues/10#issuecomment-339988213","issue_url":"https://api.github.com/repos/antonybudianto/cra-universal/issues/10","id":339988213,"user":{"login":"usefksa","id":2154387,"avatar_url":"https://avatars1.githubusercontent.com/u/2154387?v=4","gravatar_id":"","url":"https://api.github.com/users/usefksa","html_url":"https://github.com/usefksa","followers_url":"https://api.github.com/users/usefksa/followers","following_url":"https://api.github.com/users/usefksa/following{/other_user}","gists_url":"https://api.github.com/users/usefksa/gists{/gist_id}","starred_url":"https://api.github.com/users/usefksa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usefksa/subscriptions","organizations_url":"https://api.github.com/users/usefksa/orgs","repos_url":"https://api.github.com/users/usefksa/repos","events_url":"https://api.github.com/users/usefksa/events{/privacy}","received_events_url":"https://api.github.com/users/usefksa/received_events","type":"User","site_admin":false},"created_at":"2017-10-27T14:31:12Z","updated_at":"2017-10-27T14:31:12Z","author_association":"NONE","body":"Thanks\r\nit is working\r\n\r\nHere is the code, maybe someone will need it\r\n\r\n\r\n```\r\nimport { renderToNodeStream } from \"react-dom/server\";\r\nimport path from \"path\";\r\nimport { Provider } from \"react-redux\";\r\nimport React from \"react\";\r\nimport { createReactAppExpress } from \"create-react-app-express\";\r\n\r\nimport App from \"../../src/App\";\r\nimport configureStore from \"../../src/store/index.js\";\r\nconst clientBuildPath = path.resolve(__dirname, \"client\");\r\n\r\nfunction handleUniversalRender(req, res) {\r\n  const initialState = {};\r\n  const store = configureStore(initialState);\r\n  console.log(store);\r\n  const stream = renderToNodeStream(\r\n    <Provider store={store}>\r\n      <App />\r\n    </Provider>\r\n  );\r\n\r\n  return stream;\r\n}\r\nconst app = createReactAppExpress({\r\n  clientBuildPath,\r\n  universalRender: handleUniversalRender\r\n});\r\n\r\nmodule.exports = app;\r\n```"}}
{"actor":{"display_login":"usefksa"}}