{"action":"created","issue":{"url":"https://api.github.com/repos/denvned/isomorphic-relay-router/issues/38","repository_url":"https://api.github.com/repos/denvned/isomorphic-relay-router","labels_url":"https://api.github.com/repos/denvned/isomorphic-relay-router/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/denvned/isomorphic-relay-router/issues/38/comments","events_url":"https://api.github.com/repos/denvned/isomorphic-relay-router/issues/38/events","html_url":"https://github.com/denvned/isomorphic-relay-router/issues/38","id":161877249,"number":38,"title":"Loading indefinitely on errors","user":{"login":"papigers","id":5209100,"avatar_url":"https://avatars.githubusercontent.com/u/5209100?v=3","gravatar_id":"","url":"https://api.github.com/users/papigers","html_url":"https://github.com/papigers","followers_url":"https://api.github.com/users/papigers/followers","following_url":"https://api.github.com/users/papigers/following{/other_user}","gists_url":"https://api.github.com/users/papigers/gists{/gist_id}","starred_url":"https://api.github.com/users/papigers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/papigers/subscriptions","organizations_url":"https://api.github.com/users/papigers/orgs","repos_url":"https://api.github.com/users/papigers/repos","events_url":"https://api.github.com/users/papigers/events{/privacy}","received_events_url":"https://api.github.com/users/papigers/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-23T09:24:07Z","updated_at":"2016-06-23T16:19:43Z","closed_at":"2016-06-23T16:19:43Z","body":"I've noticed an issue since implementing isomorphic-relay & isomorphic-relay-router in my project.\r\nWhenever I have an error in my code, for example using an undefined variable, the page never gets loaded and I get no error, neither on my command line nor on the chrome console.\r\n\r\nI've managed to restore the error, on my root route component I render as follows:\r\n```\r\nrender(){\r\n...some code...\r\n<AppToolbar\r\n            onLogoClick={this.onLogoClick.bind(this)}\r\n            zDepth={2}\r\n            title=\"QUESTION IT\"\r\n            flexibleSpaceElement={flexibleSpace}\r\n            logoUrl={logo}\r\n            tabsElement={tabs}\r\n            loggedOn={loggedon}\r\n            undefined={undefined} //this is undefined variable, when the line is commented everything works as usual \r\n  //when I uncommet this line, the page is loaded indefinitely and I get no errors.\r\n/>\r\n...some code....\r\n}\r\n```\r\n\r\nI've tried to follow the readme:\r\n**server.js:**\r\n```\r\nmatch({ routes, location }, (err, redirectLocation, renderProps) => {\r\n\t\t\tif (err) {\r\n\t\t\t\tconsole.error(err);\r\n\t\t\t\treturn res.status(500).end('Internal server error');\r\n\t\t\t}\r\n      if (redirectLocation){\r\n        return res.redirect(redirectLocation.pathname + redirectLocation.search);\r\n      }\r\n\t\t\tif (!renderProps) return res.status(404).end('Not found.');\r\n      \r\n      IsomorphicRouter.prepareData(renderProps, networkLayer).then(render,console.error);\r\n      \r\n      function render ({data, props}){\r\n\t\t\tconst userAgent = req.headers['user-agent'];\r\n      \r\n      const InitialComponent = (\r\n        <Root\r\n          userAgent={userAgent}\r\n          onInsertCss={(styles) => css.push(styles._getCss())}\r\n        >\r\n          {IsomorphicRouter.render(props)}\r\n        </Root>\r\n      );\r\n\r\n      let preloadedData = JSON.stringify(data);\r\n\r\n      const componentHTML = renderToString(InitialComponent);\r\n      const HTML = `\r\n      <!DOCTYPE html>\r\n      <html>\r\n        <head>\r\n          <meta charset=\"utf-8\">\r\n          <meta name=\"theme-color\" content=\"#950000\">\r\n          <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n          <title>Question It - Online Polls</title>\r\n          <script async type=\"application/javascript\" src=\"/build/bundle.js\"></script>\r\n          <style type=\"text/css\">${css.join('')}</style>\r\n          <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>\r\n          <link href=\"https://file.myfontastic.com/m6D5EwwEfBU4hxAfLHHbdR/icons.css\" rel=\"stylesheet\">\r\n        </head>\r\n        <body>\r\n          <div id=\"react-view\">${componentHTML}</div>\r\n          <script id=\"preloadedData\" type=\"application/json\" src=\"\">\r\n            ${JSON.stringify(preloadedData).replace(/\\//g, '\\\\/')}\r\n          </script>\r\n        </body>\r\n      </html>\r\n      `;\r\n\r\n      res.end(HTML); \r\n      }\r\n```\r\n\r\n**client.js:**\r\n```\r\nconst environment = new Relay.Environment();\r\nenvironment.injectNetworkLayer(new Relay.DefaultNetworkLayer('/graphql'));\r\n\r\nconst data = JSON.parse(JSON.parse(document.getElementById('preloadedData').textContent));\r\n\r\nIsomorphicRelay.injectPreparedData(environment, data);\r\n\r\nvar injectTapEventPlugin = require(\"react-tap-event-plugin\");\r\ninjectTapEventPlugin();\r\n\r\nmatch({routes, history: browserHistory}, (error, redirectLocation, renderProps) => {\r\n  IsomorphicRouter.prepareInitialRender(environment, renderProps).then(props => {\r\n    render(\r\n      <Root onInsertCss={(styles) => styles._insertCss()}>\r\n        <Router {...props} onUpdate={() => window.scrollTo(0, 0)} />\r\n      </Root>,  \r\n      document.getElementById('react-view'));\r\n  });\r\n});\r\n```\r\n\r\nAny ideas?"},"comment":{"url":"https://api.github.com/repos/denvned/isomorphic-relay-router/issues/comments/228103388","html_url":"https://github.com/denvned/isomorphic-relay-router/issues/38#issuecomment-228103388","issue_url":"https://api.github.com/repos/denvned/isomorphic-relay-router/issues/38","id":228103388,"user":{"login":"papigers","id":5209100,"avatar_url":"https://avatars.githubusercontent.com/u/5209100?v=3","gravatar_id":"","url":"https://api.github.com/users/papigers","html_url":"https://github.com/papigers","followers_url":"https://api.github.com/users/papigers/followers","following_url":"https://api.github.com/users/papigers/following{/other_user}","gists_url":"https://api.github.com/users/papigers/gists{/gist_id}","starred_url":"https://api.github.com/users/papigers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/papigers/subscriptions","organizations_url":"https://api.github.com/users/papigers/orgs","repos_url":"https://api.github.com/users/papigers/repos","events_url":"https://api.github.com/users/papigers/events{/privacy}","received_events_url":"https://api.github.com/users/papigers/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T16:19:43Z","updated_at":"2016-06-23T16:19:43Z","body":"That's it! thank you very much.\r\n\r\nAny way this could be done with the async/await feature?  \r\nI've tried:\r\n```\r\ntry{\r\n        let {data, props} = await IsomorphicRouter.prepareData(renderProps, networkLayer);//.then(render).catch(next);\r\n      } catch(err){\r\n        console.error(err);\r\n      }\r\n```\r\nBut that doesn't seem to be working. anyway the code you gave is good enoguh so I guess this can be closed, but I'd happy to learn the solution for async/await.\r\nTY again :+1: \r\n"}}
{"actor":{"display_login":"papigers"}}