{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/react-rails/issues/146","labels_url":"https://api.github.com/repos/reactjs/react-rails/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-rails/issues/146/comments","events_url":"https://api.github.com/repos/reactjs/react-rails/issues/146/events","html_url":"https://github.com/reactjs/react-rails/issues/146","id":54000851,"number":146,"title":"Server rendering: \"document is not defined\" on refresh (reconcile transaction problem?)","user":{"login":"olance","id":314079,"avatar_url":"https://avatars.githubusercontent.com/u/314079?v=3","gravatar_id":"","url":"https://api.github.com/users/olance","html_url":"https://github.com/olance","followers_url":"https://api.github.com/users/olance/followers","following_url":"https://api.github.com/users/olance/following{/other_user}","gists_url":"https://api.github.com/users/olance/gists{/gist_id}","starred_url":"https://api.github.com/users/olance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olance/subscriptions","organizations_url":"https://api.github.com/users/olance/orgs","repos_url":"https://api.github.com/users/olance/repos","events_url":"https://api.github.com/users/olance/events{/privacy}","received_events_url":"https://api.github.com/users/olance/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-01-11T19:00:21Z","updated_at":"2015-06-11T19:55:37Z","closed_at":null,"body":"I'm facing a strange issue...\r\n\r\nI have a Rails app configured to use react-rails and use the prerendering feature.\r\nWhen I first load my home page, it renders well without any errors. I can confirm it is prerendered on the server as the received HTML contains the complete markup.\r\n\r\nHowever, when I refresh the page (simple Cmd+R), I get the following error:\r\n\r\n> Encountered error \"ReferenceError: document is not defined\" when prerendering AppRouter with { ... state object ...  }\r\n\r\nThere's no trace of a `document` call/access in my javascript code.\r\n\r\nThis is how `AppRouter` is rendered in my view:\r\n```ruby\r\n<%= react_component('AppRouter', { initialAppState: @application_state }, { prerender: true }) %>\r\n```\r\n\r\nKilling and restarting the dev server \"fixes\" the problem until the next refresh is done.\r\nChanging some code in the AppRouter component will usually have it working again for the next refresh...\r\n\r\nSo this does look like a cache issue, but I can't figure out what exactly is going on?"},"comment":{"url":"https://api.github.com/repos/reactjs/react-rails/issues/comments/111258796","html_url":"https://github.com/reactjs/react-rails/issues/146#issuecomment-111258796","issue_url":"https://api.github.com/repos/reactjs/react-rails/issues/146","id":111258796,"user":{"login":"olance","id":314079,"avatar_url":"https://avatars.githubusercontent.com/u/314079?v=3","gravatar_id":"","url":"https://api.github.com/users/olance","html_url":"https://github.com/olance","followers_url":"https://api.github.com/users/olance/followers","following_url":"https://api.github.com/users/olance/following{/other_user}","gists_url":"https://api.github.com/users/olance/gists{/gist_id}","starred_url":"https://api.github.com/users/olance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olance/subscriptions","organizations_url":"https://api.github.com/users/olance/orgs","repos_url":"https://api.github.com/users/olance/repos","events_url":"https://api.github.com/users/olance/events{/privacy}","received_events_url":"https://api.github.com/users/olance/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T19:55:37Z","updated_at":"2015-06-11T19:55:37Z","body":"Well of course it worked @navela, `componentDidMount()` is not called on the server side :)"}}