{"action":"created","issue":{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/703","labels_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/703/labels{/name}","comments_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/703/comments","events_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/703/events","html_url":"https://github.com/bem/bem-forum-content-ru/issues/703","id":115750829,"number":703,"title":"сайт на полном стеке bem vm bemtree","user":{"login":"rustam-mh","id":13362817,"avatar_url":"https://avatars.githubusercontent.com/u/13362817?v=3","gravatar_id":"","url":"https://api.github.com/users/rustam-mh","html_url":"https://github.com/rustam-mh","followers_url":"https://api.github.com/users/rustam-mh/followers","following_url":"https://api.github.com/users/rustam-mh/following{/other_user}","gists_url":"https://api.github.com/users/rustam-mh/gists{/gist_id}","starred_url":"https://api.github.com/users/rustam-mh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rustam-mh/subscriptions","organizations_url":"https://api.github.com/users/rustam-mh/orgs","repos_url":"https://api.github.com/users/rustam-mh/repos","events_url":"https://api.github.com/users/rustam-mh/events{/privacy}","received_events_url":"https://api.github.com/users/rustam-mh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/bemtree","name":"bemtree","color":"bfe5bf"},{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/labels/generator-bem-stub","name":"generator-bem-stub","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-08T18:32:44Z","updated_at":"2015-11-08T18:40:35Z","closed_at":null,"body":"подскажите пожалуйста в чем ошибка \r\n\r\nкод:\r\n```js\r\n\tvar bemtreeTemplate = fs.readFileSync(path.join('.',pathToBundle, 'index.bemtree.js'), 'utf-8');\r\n\tvar context = vm.createContext({\r\n\t\tconsole: console,\r\n\t\trequire: require,\r\n\t\tVow: vow\r\n\t});\r\n\tvm.runInContext(bemtreeTemplate, context);\r\n```\r\nошибка:\r\n```\r\nnode ./desktop.bundles/index/index.node.js\r\nevalmachine.<anonymous>:85\r\n       if('onreadystatechange' in doc.createElement('script')) { // ie6-ie8\r\n                                      ^\r\n\r\nTypeError: Cannot read property 'createElement' of undefined\r\n    at evalmachine.<anonymous>:85:39\r\n    at evalmachine.<anonymous>:104:7\r\n    at Object.__vow_init (evalmachine.<anonymous>:1331:3)\r\n    at buildBemXjst (evalmachine.<anonymous>:1335:12)\r\n    at evalmachine.<anonymous>:1603:25\r\n    at evalmachine.<anonymous>:1605:3\r\n    at Object.exports.runInContext (vm.js:44:17)\r\n    at /home/rustam/work/newkent/desktop.blocks/server/server.node.js:18:5\r\n    at pendingRequires.push.cb (/home/rustam/work/newkent/desktop.bundles/index/index.node.js:88:32)\r\n    at onDeclResolved (/home/rustam/work/newkent/desktop.bundles/index/index.node.js:175:29)\r\n```"},"comment":{"url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/comments/154856333","html_url":"https://github.com/bem/bem-forum-content-ru/issues/703#issuecomment-154856333","issue_url":"https://api.github.com/repos/bem/bem-forum-content-ru/issues/703","id":154856333,"user":{"login":"tadatuta","id":475746,"avatar_url":"https://avatars.githubusercontent.com/u/475746?v=3","gravatar_id":"","url":"https://api.github.com/users/tadatuta","html_url":"https://github.com/tadatuta","followers_url":"https://api.github.com/users/tadatuta/followers","following_url":"https://api.github.com/users/tadatuta/following{/other_user}","gists_url":"https://api.github.com/users/tadatuta/gists{/gist_id}","starred_url":"https://api.github.com/users/tadatuta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tadatuta/subscriptions","organizations_url":"https://api.github.com/users/tadatuta/orgs","repos_url":"https://api.github.com/users/tadatuta/repos","events_url":"https://api.github.com/users/tadatuta/events{/privacy}","received_events_url":"https://api.github.com/users/tadatuta/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T18:40:35Z","updated_at":"2015-11-08T18:40:35Z","body":"Нужно пробросить `setImmediate` в контексте, где выполняются шаблоны:\r\n```js\r\nvar context = vm.createContext({\r\n        console: console,\r\n        setImmediate: setImmediate, // вот эта строчка\r\n        require: require,\r\n        Vow: vow\r\n    });\r\n```"}}