{"action":"created","issue":{"url":"https://api.github.com/repos/NodeSquarespace/node-squarespace-server/issues/134","labels_url":"https://api.github.com/repos/NodeSquarespace/node-squarespace-server/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/NodeSquarespace/node-squarespace-server/issues/134/comments","events_url":"https://api.github.com/repos/NodeSquarespace/node-squarespace-server/issues/134/events","html_url":"https://github.com/NodeSquarespace/node-squarespace-server/issues/134","id":108703925,"number":134,"title":"TypeError: Cannot read property 'replace' of undefined","user":{"login":"mwickett","id":845983,"avatar_url":"https://avatars.githubusercontent.com/u/845983?v=3","gravatar_id":"","url":"https://api.github.com/users/mwickett","html_url":"https://github.com/mwickett","followers_url":"https://api.github.com/users/mwickett/followers","following_url":"https://api.github.com/users/mwickett/following{/other_user}","gists_url":"https://api.github.com/users/mwickett/gists{/gist_id}","starred_url":"https://api.github.com/users/mwickett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwickett/subscriptions","organizations_url":"https://api.github.com/users/mwickett/orgs","repos_url":"https://api.github.com/users/mwickett/repos","events_url":"https://api.github.com/users/mwickett/events{/privacy}","received_events_url":"https://api.github.com/users/mwickett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-28T17:16:50Z","updated_at":"2015-09-28T17:55:51Z","closed_at":null,"body":"Getting this error:\r\n\r\n````\r\n/usr/local/lib/node_modules/node-squarespace-server/squarespace-template.js:476\r\n        rendered += templates.regions[ regionKey ].replace( SQS_MAIN_CONTENT, \r\n                                                  ^\r\nTypeError: Cannot read property 'replace' of undefined\r\n    at Object.renderTemplate (/usr/local/lib/node_modules/node-squarespace-server/squarespace-template.js:476:51)\r\n    at /usr/local/lib/node_modules/node-squarespace-server/squarespace-server.js:228:29\r\n    at /usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-middleware/squarespace-middleware.js:311:13\r\n    at Request._callback (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-middleware/squarespace-middleware.js:234:9)\r\n    at Request.self.callback (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:198:22)\r\n    at Request.emit (events.js:110:17)\r\n    at Request.<anonymous> (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:1063:14)\r\n    at Request.emit (events.js:129:20)\r\n    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:1009:12)\r\n    at IncomingMessage.emit (events.js:129:20)\r\n````\r\n\r\nI'm using a custom template (started from base-template). I have a site-wide password turned on and configured properly in template.conf.\r\n\r\nIf I run `sqs server` again, I get:\r\n\r\n````\r\nundefined:0\r\n\r\n\r\nSyntaxError: Unexpected end of input\r\n    at Object.parse (native)\r\n    at /usr/local/lib/node_modules/node-squarespace-server/squarespace-util.js:90:22\r\n    at /usr/local/lib/node_modules/node-squarespace-server/squarespace-util.js:77:17\r\n    at fs.js:334:14\r\n    at FSReqWrap.oncomplete (fs.js:95:15)\r\n````\r\n\r\nRunning `sqs buster` and then `sqs serve` again gets the first error again."},"comment":{"url":"https://api.github.com/repos/NodeSquarespace/node-squarespace-server/issues/comments/143825012","html_url":"https://github.com/NodeSquarespace/node-squarespace-server/issues/134#issuecomment-143825012","issue_url":"https://api.github.com/repos/NodeSquarespace/node-squarespace-server/issues/134","id":143825012,"user":{"login":"mwickett","id":845983,"avatar_url":"https://avatars.githubusercontent.com/u/845983?v=3","gravatar_id":"","url":"https://api.github.com/users/mwickett","html_url":"https://github.com/mwickett","followers_url":"https://api.github.com/users/mwickett/followers","following_url":"https://api.github.com/users/mwickett/following{/other_user}","gists_url":"https://api.github.com/users/mwickett/gists{/gist_id}","starred_url":"https://api.github.com/users/mwickett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwickett/subscriptions","organizations_url":"https://api.github.com/users/mwickett/orgs","repos_url":"https://api.github.com/users/mwickett/repos","events_url":"https://api.github.com/users/mwickett/events{/privacy}","received_events_url":"https://api.github.com/users/mwickett/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T17:55:51Z","updated_at":"2015-09-28T17:55:51Z","body":"I was just reading over the closed issues related to static page implementation. \r\n\r\nCollection object output:\r\n\r\n```\r\ncollection: {\r\nid: \"55f05817e4b0922a8954cdec\",\r\nwebsiteId: \"55c51a9ae4b0b6679a5aca46\",\r\nenabled: true,\r\nstarred: false,\r\ntype: 7,\r\nordering: 2,\r\ntitle: \"Home\",\r\nnavigationTitle: \"Home\",\r\nurlId: \"home\",\r\nitemCount: 0,\r\nupdatedOn: 1441814551001,\r\ndescription: \"\",\r\nfeatures: {\r\nrelatedItems: {\r\nisEnabled: false\r\n},\r\nproductQuickView: {\r\nisEnabled: false\r\n}\r\n},\r\nfolder: false,\r\ndropdown: false,\r\ntags: [ ],\r\ncategories: [ ],\r\nhomepage: true,\r\ntypeName: \"home\",\r\nregionName: \"home\",\r\nsynchronizing: false,\r\nfullUrl: \"/\",\r\ntypeLabel: \"home\",\r\npasswordProtected: false\r\n},\r\n````\r\n\r\nSorry the output is kind of fugly."}}