{"action":"created","issue":{"url":"https://api.github.com/repos/primaryobjects/contentblocks/issues/8","labels_url":"https://api.github.com/repos/primaryobjects/contentblocks/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/primaryobjects/contentblocks/issues/8/comments","events_url":"https://api.github.com/repos/primaryobjects/contentblocks/issues/8/events","html_url":"https://github.com/primaryobjects/contentblocks/issues/8","id":57729109,"number":8,"title":"Getting \"Socket hang up\" error when putting multiple blocks in one view","user":{"login":"MikeMugu","id":8614383,"avatar_url":"https://avatars.githubusercontent.com/u/8614383?v=3","gravatar_id":"","url":"https://api.github.com/users/MikeMugu","html_url":"https://github.com/MikeMugu","followers_url":"https://api.github.com/users/MikeMugu/followers","following_url":"https://api.github.com/users/MikeMugu/following{/other_user}","gists_url":"https://api.github.com/users/MikeMugu/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeMugu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeMugu/subscriptions","organizations_url":"https://api.github.com/users/MikeMugu/orgs","repos_url":"https://api.github.com/users/MikeMugu/repos","events_url":"https://api.github.com/users/MikeMugu/events{/privacy}","received_events_url":"https://api.github.com/users/MikeMugu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/primaryobjects/contentblocks/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-15T12:42:12Z","updated_at":"2015-02-16T01:32:19Z","closed_at":null,"body":"Hi. I pretty much have everything working on my site using your nice plugin, however when I went to add a second block to my page I started getting a \"Socket hang up\" error. I have traced this down to what I think is in lib/contentblocks.js line 81:\r\n\r\n webManagerSendSync(contentBlockItems, index + 1);\r\n\r\nThis is a recursive call to continue retrieving the block markup but appears to cause the \"Socket hang up\" error whenever I have more than one block on the page. \r\n\r\nI have tried to work around this but I am kinda new to NodeJS so have been struggling. "},"comment":{"url":"https://api.github.com/repos/primaryobjects/contentblocks/issues/comments/74449242","html_url":"https://github.com/primaryobjects/contentblocks/issues/8#issuecomment-74449242","issue_url":"https://api.github.com/repos/primaryobjects/contentblocks/issues/8","id":74449242,"user":{"login":"primaryobjects","id":529049,"avatar_url":"https://avatars.githubusercontent.com/u/529049?v=3","gravatar_id":"","url":"https://api.github.com/users/primaryobjects","html_url":"https://github.com/primaryobjects","followers_url":"https://api.github.com/users/primaryobjects/followers","following_url":"https://api.github.com/users/primaryobjects/following{/other_user}","gists_url":"https://api.github.com/users/primaryobjects/gists{/gist_id}","starred_url":"https://api.github.com/users/primaryobjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/primaryobjects/subscriptions","organizations_url":"https://api.github.com/users/primaryobjects/orgs","repos_url":"https://api.github.com/users/primaryobjects/repos","events_url":"https://api.github.com/users/primaryobjects/events{/privacy}","received_events_url":"https://api.github.com/users/primaryobjects/received_events","type":"User","site_admin":false},"created_at":"2015-02-16T01:32:19Z","updated_at":"2015-02-16T01:32:19Z","body":"I can't see anything obvious that would cause the problem.\r\n\r\nI would first try directly calling your web service to test the calls, using something like [Advanced REST client](https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo). This way, you can verify the right json is coming back for the 1st and 2nd content block ids. For the 'Find' call, do an HTTP GET\r\n\r\nMaybe also try swapping out your back-end service for the default redant service and see if this one works correctly.\r\n\r\n```\r\nvar contentBlocks = require('contentblocks')({ app: app, host: 'red-ant.herokuapp.com', pathFind: '/v1/nest/find?q={\"@subject\":\"[id]\"}', pathPost: '/v1/nest', pathPut: '/v1/nest/[id]', pathDelete: '/v1/nest/[id]' });\r\n```\r\n\r\nIf switching to redant works correctly, then you know something is going on in your backend service. If you still have the same problem on redant, then you know the problem is in your client code."}}