{"action":"closed","issue":{"url":"https://api.github.com/repos/balderdashy/sails/issues/2334","labels_url":"https://api.github.com/repos/balderdashy/sails/issues/2334/labels{/name}","comments_url":"https://api.github.com/repos/balderdashy/sails/issues/2334/comments","events_url":"https://api.github.com/repos/balderdashy/sails/issues/2334/events","html_url":"https://github.com/balderdashy/sails/issues/2334","id":46717572,"number":2334,"title":"`res.serverError('string')` causes error when using handlebars as view engine","user":{"login":"h0ward","id":2399065,"avatar_url":"https://avatars.githubusercontent.com/u/2399065?v=3","gravatar_id":"","url":"https://api.github.com/users/h0ward","html_url":"https://github.com/h0ward","followers_url":"https://api.github.com/users/h0ward/followers","following_url":"https://api.github.com/users/h0ward/following{/other_user}","gists_url":"https://api.github.com/users/h0ward/gists{/gist_id}","starred_url":"https://api.github.com/users/h0ward/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h0ward/subscriptions","organizations_url":"https://api.github.com/users/h0ward/orgs","repos_url":"https://api.github.com/users/h0ward/repos","events_url":"https://api.github.com/users/h0ward/events{/privacy}","received_events_url":"https://api.github.com/users/h0ward/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-24T09:01:31Z","updated_at":"2015-10-10T05:07:25Z","closed_at":"2015-10-10T05:07:24Z","body":"To reproduce:\r\n1. [Setup](https://github.com/sails101/using-handlebars#sails-with-handlebars) sails app with Handlebars as view engine\r\n2. Route index to `TestController.js` controller `'/': {controller: 'test'}`\r\n3. Inside `TestController.js` throw  `index: function (req, res) {res.serverError('test')}`\r\n4. `sails lift` and you will see\r\n```\r\nerror: Sending 500 (\"Server Error\") response: \r\n test\r\nwarn: res.serverError() :: When attempting to render error page view, an error occured (sending JSON instead).  Details:  TypeError: Cannot use 'in' operator to search for 'root' in test\r\n  at initData (/Users/howard/couch-auctmarts/src/printer/node_modules/handlebars/dist/cjs/handlebars/runtime.js:188:28)\r\n  at ret (/Users/howard/couch-auctmarts/src/printer/node_modules/handlebars/dist/cjs/handlebars/runtime.js:130:14)\r\n  at ret (/Users/howard/couch-auctmarts/src/printer/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:422:21)\r\n  at ExpressHandlebars._renderTemplate (/Users/howard/couch-auctmarts/src/printer/node_modules/sails/node_modules/express-handlebars/lib/express-handlebars.js:296:12)\r\n  at ExpressHandlebars.<anonymous> (/Users/howard/couch-auctmarts/src/printer/node_modules/sails/node_modules/express-handlebars/lib/express-handlebars.js:170:21)\r\n  at /Users/howard/couch-auctmarts/src/printer/node_modules/sails/node_modules/express-handlebars/node_modules/promise/core.js:33:15\r\n  at flush (/Users/howard/couch-auctmarts/src/printer/node_modules/sails/node_modules/express-handlebars/node_modules/promise/node_modules/asap/asap.js:27:13)\r\n  at process._tickDomainCallback (node.js:463:13)\r\n [TypeError: Cannot use 'in' operator to search for 'root' in test]\r\n```"}}