{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/react-router/issues/3176","repository_url":"https://api.github.com/repos/reactjs/react-router","labels_url":"https://api.github.com/repos/reactjs/react-router/issues/3176/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-router/issues/3176/comments","events_url":"https://api.github.com/repos/reactjs/react-router/issues/3176/events","html_url":"https://github.com/reactjs/react-router/issues/3176","id":140161474,"number":3176,"title":"Need help with rails + react-rails gem + react router server rendering","user":{"login":"pioz","id":215905,"avatar_url":"https://avatars.githubusercontent.com/u/215905?v=3","gravatar_id":"","url":"https://api.github.com/users/pioz","html_url":"https://github.com/pioz","followers_url":"https://api.github.com/users/pioz/followers","following_url":"https://api.github.com/users/pioz/following{/other_user}","gists_url":"https://api.github.com/users/pioz/gists{/gist_id}","starred_url":"https://api.github.com/users/pioz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pioz/subscriptions","organizations_url":"https://api.github.com/users/pioz/orgs","repos_url":"https://api.github.com/users/pioz/repos","events_url":"https://api.github.com/users/pioz/events{/privacy}","received_events_url":"https://api.github.com/users/pioz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/reactjs/react-router/labels/invalid:%20support%20request","name":"invalid: support request","color":"e6e6e6"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-11T11:32:13Z","updated_at":"2016-04-01T06:55:42Z","closed_at":"2016-03-11T12:55:25Z","body":"I have create this sample repo that use rails (v4.2.6) with react-rails (v1.6.2) and react-router (v2.0.0-rc5): https://github.com/pioz/rails_with_react_and_react_router_example\r\n\r\nIn the file `app/views/application/react_entry_point.html.erb` I render the component `MountUp` with\r\n```\r\n<%= react_component('MountUp', {}, {prerender: false}) %>\r\n```\r\nThe component `MountUp` render my router:\r\n```\r\nclass MountUp extends React.Component {\r\n  render() {\r\n    return(\r\n      <Router history={History}>\r\n        <Route path=\"/\" component={App}>\r\n          <IndexRoute component={Index} />\r\n          <Route path=\"/contact\" component={Contact}/>\r\n          <Route path=\"/about\" component={About}/>\r\n        </Route>\r\n      </Router>\r\n    )\r\n  }\r\n}\r\n```\r\n\r\nAll works fine, but if I change the option `prerender: true` I get a strange error `React::ServerRendering::PrerenderError in Application#react_entry_point`:\r\n```\r\nEncountered error \"Error: Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.\" when prerendering MountUp with {}\r\nObject.invariant [as default] ((execjs):21983:16)\r\ncreateHashHistory ((execjs):24108:130)\r\n(execjs):22633:20\r\nwrapDeprecatedHistory ((execjs):25285:61)\r\ncreateRouterObjects ((execjs):25259:23)\r\ncomponentWillMount ((execjs):25228:38)\r\nReactCompositeComponentMixin.mountComponent ((execjs):8138:13)\r\nwrapper [as mountComponent] ((execjs):3131:22)\r\nObject.ReactReconciler.mountComponent ((execjs):6583:36)\r\nReactCompositeComponentMixin.mountComponent ((execjs):8153:35)\r\n/Users/pioz/.rvm/gems/ruby-2.3.0/gems/execjs-2.6.0/lib/execjs/external_runtime.rb:39:in `exec'\r\n...\r\n```\r\n\r\nHow can I render this app server side? Is this the right way to do this?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/reactjs/react-router/issues/comments/204275607","html_url":"https://github.com/reactjs/react-router/issues/3176#issuecomment-204275607","issue_url":"https://api.github.com/repos/reactjs/react-router/issues/3176","id":204275607,"user":{"login":"pioz","id":215905,"avatar_url":"https://avatars.githubusercontent.com/u/215905?v=3","gravatar_id":"","url":"https://api.github.com/users/pioz","html_url":"https://github.com/pioz","followers_url":"https://api.github.com/users/pioz/followers","following_url":"https://api.github.com/users/pioz/following{/other_user}","gists_url":"https://api.github.com/users/pioz/gists{/gist_id}","starred_url":"https://api.github.com/users/pioz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pioz/subscriptions","organizations_url":"https://api.github.com/users/pioz/orgs","repos_url":"https://api.github.com/users/pioz/repos","events_url":"https://api.github.com/users/pioz/events{/privacy}","received_events_url":"https://api.github.com/users/pioz/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T06:55:42Z","updated_at":"2016-04-01T06:55:42Z","body":"@knowbody see http://stackoverflow.com/questions/35939324/server-rendering-with-rails-react-rails-gem-react-router"}}