{"action":"created","issue":{"url":"https://api.github.com/repos/zeit/next.js/issues/207","repository_url":"https://api.github.com/repos/zeit/next.js","labels_url":"https://api.github.com/repos/zeit/next.js/issues/207/labels{/name}","comments_url":"https://api.github.com/repos/zeit/next.js/issues/207/comments","events_url":"https://api.github.com/repos/zeit/next.js/issues/207/events","html_url":"https://github.com/zeit/next.js/issues/207","id":187508094,"number":207,"title":"getInitialProps error when result is a simple string","user":{"login":"stlbucket","id":2467892,"avatar_url":"https://avatars.githubusercontent.com/u/2467892?v=3","gravatar_id":"","url":"https://api.github.com/users/stlbucket","html_url":"https://github.com/stlbucket","followers_url":"https://api.github.com/users/stlbucket/followers","following_url":"https://api.github.com/users/stlbucket/following{/other_user}","gists_url":"https://api.github.com/users/stlbucket/gists{/gist_id}","starred_url":"https://api.github.com/users/stlbucket/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stlbucket/subscriptions","organizations_url":"https://api.github.com/users/stlbucket/orgs","repos_url":"https://api.github.com/users/stlbucket/repos","events_url":"https://api.github.com/users/stlbucket/events{/privacy}","received_events_url":"https://api.github.com/users/stlbucket/received_events","type":"User","site_admin":false},"labels":[{"id":455907200,"url":"https://api.github.com/repos/zeit/next.js/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-05T16:52:14Z","updated_at":"2016-11-05T18:58:22Z","closed_at":"2016-11-05T18:48:01Z","body":"i have a server with a ping endpoint, and a next client with a component as follows:\r\n```\r\nimport React from 'react'\r\nimport 'isomorphic-fetch'\r\nexport default class extends React.Component {\r\n\tstatic async getInitialProps () {\r\n\t\tconst res = await fetch('http://localhost:20831/Ping')\r\n\t\tconst data = await res.json()\r\n\t\treturn { pingResult: data }\r\n\t}\r\n\t\r\n\trender(){\r\n\t\tconsole.log('PING', this.props);\r\n\t\t\r\n\t\treturn <div>\r\n\t\t\t<h3>PING</h3>\r\n\t\t</div>\r\n\t}\r\n}\r\n```\r\n\r\nIf my Ping endpoint returns:\r\n\r\n`\r\n{\r\n  data: 'GET ALL PING\r\n}\r\n`\r\n\r\neverything is fine.\r\n\r\nHowever, if it returns:\r\n\r\n`\r\n'GET ALL PING'\r\n`\r\n\r\nI get the following error in the server render for next:\r\n\r\n```\r\nSyntaxError: Unexpected token G in JSON at position 0\r\n    at Object.parse (native)\r\n    at D:\\git2\\fbkt-next\\node_modules\\node-fetch\\lib\\body.js:48:15\r\n    at process._tickCallback (internal/process/next_tick.js:103:7)\r\n```\r\n\r\nCan I not return a simple string to the getInitialProps call?\r\n"},"comment":{"url":"https://api.github.com/repos/zeit/next.js/issues/comments/258633366","html_url":"https://github.com/zeit/next.js/issues/207#issuecomment-258633366","issue_url":"https://api.github.com/repos/zeit/next.js/issues/207","id":258633366,"user":{"login":"siddharthkp","id":1863771,"avatar_url":"https://avatars.githubusercontent.com/u/1863771?v=3","gravatar_id":"","url":"https://api.github.com/users/siddharthkp","html_url":"https://github.com/siddharthkp","followers_url":"https://api.github.com/users/siddharthkp/followers","following_url":"https://api.github.com/users/siddharthkp/following{/other_user}","gists_url":"https://api.github.com/users/siddharthkp/gists{/gist_id}","starred_url":"https://api.github.com/users/siddharthkp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddharthkp/subscriptions","organizations_url":"https://api.github.com/users/siddharthkp/orgs","repos_url":"https://api.github.com/users/siddharthkp/repos","events_url":"https://api.github.com/users/siddharthkp/events{/privacy}","received_events_url":"https://api.github.com/users/siddharthkp/received_events","type":"User","site_admin":false},"created_at":"2016-11-05T18:58:22Z","updated_at":"2016-11-05T18:58:22Z","body":"@nkzawa I think you got the question wrong.\r\n\r\n@stlbucket You are using `res.json` but your response is not valid json. Just replace that with `res.text()`"}}
{"actor":{"display_login":"siddharthkp"}}