{"action":"reopened","issue":{"url":"https://api.github.com/repos/cssinjs/jss/issues/292","repository_url":"https://api.github.com/repos/cssinjs/jss","labels_url":"https://api.github.com/repos/cssinjs/jss/issues/292/labels{/name}","comments_url":"https://api.github.com/repos/cssinjs/jss/issues/292/comments","events_url":"https://api.github.com/repos/cssinjs/jss/issues/292/events","html_url":"https://github.com/cssinjs/jss/issues/292","id":172310042,"number":292,"title":"compatibility with hyperscript on server","user":{"login":"tusharmath","id":194482,"avatar_url":"https://avatars.githubusercontent.com/u/194482?v=3","gravatar_id":"","url":"https://api.github.com/users/tusharmath","html_url":"https://github.com/tusharmath","followers_url":"https://api.github.com/users/tusharmath/followers","following_url":"https://api.github.com/users/tusharmath/following{/other_user}","gists_url":"https://api.github.com/users/tusharmath/gists{/gist_id}","starred_url":"https://api.github.com/users/tusharmath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tusharmath/subscriptions","organizations_url":"https://api.github.com/users/tusharmath/orgs","repos_url":"https://api.github.com/users/tusharmath/repos","events_url":"https://api.github.com/users/tusharmath/events{/privacy}","received_events_url":"https://api.github.com/users/tusharmath/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cssinjs/jss/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-21T08:00:32Z","updated_at":"2016-08-22T21:49:50Z","closed_at":null,"body":"[Hyperscript]() depends on [html-element](https://github.com/1N50MN14/html-element/blob/master/index.js#L1) which internally setups a mock `document` object on the `global` object when run in node.js env.\r\n\r\nThis causes the [findRenderer](https://github.com/cssinjs/jss/blob/master/src/findRenderer.js#L15) to bailout because it depends on the `document` object.\r\n\r\n```stack\r\nTypeError: document.getElementsByTagName is not a function\r\n    at DomRenderer.createElement (/Users/tushar.mathur/Documents/Projects/funag/node_modules/jss/lib/backends/DomRenderer.js:39:45)\r\n    at new StyleSheet (/Users/tushar.mathur/Documents/Projects/funag/node_modules/jss/lib/StyleSheet.js:59:19)\r\n    at Jss.createStyleSheet (/Users/tushar.mathur/Documents/Projects/funag/node_modules/jss/lib/Jss.js:100:19)\r\n    at create (CreateStyle.js:16:26)\r\n    at Object.<anonymous> (loader.style.js:9:16)\r\n    at Module._compile (module.js:541:32)\r\n    at loader (/Users/tushar.mathur/Documents/Projects/funag/node_modules/babel-register/lib/node.js:148:5)\r\n    at Object.require.extensions.(anonymous function) [as .js] (/Users/tushar.mathur/Documents/Projects/funag/node_modules/babel-register/lib/node.js:158:7)\r\n    at Module.load (module.js:458:32)\r\n    at tryModuleLoad (module.js:417:12)\r\n```\r\n\r\nI guess the better way to do this would be to use something like [detect-node](https://github.com/iliakan/detect-node)"}}
{"actor":{"display_login":"kof"}}