{"action":"opened","issue":{"url":"https://api.github.com/repos/algolia/instantsearch.js/issues/1414","repository_url":"https://api.github.com/repos/algolia/instantsearch.js","labels_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/1414/labels{/name}","comments_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/1414/comments","events_url":"https://api.github.com/repos/algolia/instantsearch.js/issues/1414/events","html_url":"https://github.com/algolia/instantsearch.js/issues/1414","id":182696575,"number":1414,"title":"Meteor compatibility","user":{"login":"rigconfig","id":1509662,"avatar_url":"https://avatars.githubusercontent.com/u/1509662?v=3","gravatar_id":"","url":"https://api.github.com/users/rigconfig","html_url":"https://github.com/rigconfig","followers_url":"https://api.github.com/users/rigconfig/followers","following_url":"https://api.github.com/users/rigconfig/following{/other_user}","gists_url":"https://api.github.com/users/rigconfig/gists{/gist_id}","starred_url":"https://api.github.com/users/rigconfig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rigconfig/subscriptions","organizations_url":"https://api.github.com/users/rigconfig/orgs","repos_url":"https://api.github.com/users/rigconfig/repos","events_url":"https://api.github.com/users/rigconfig/events{/privacy}","received_events_url":"https://api.github.com/users/rigconfig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-13T05:06:44Z","updated_at":"2016-10-13T05:06:44Z","closed_at":null,"body":"Im using:\r\n- Meteor 1.4.1.2\r\n- React as an npm module: react@15.3.2\r\n- Flow Router 1.12.1\r\n\r\nIn my main `<App/>` component I import the library from npm:\r\n\r\n```jsx\r\nimport { InstantSearch } from 'react-instantsearch';\r\n```\r\n\r\nAnd I add the instantsearch react component:\r\n\r\n```jsx\r\n<InstantSearch\r\n  appId={\"****\"}\r\n  apiKey={\"****\"}\r\n  indexName={\"****\"}\r\n>\r\n  {/* components go here */}\r\n</InstantSearch>\r\n```\r\n\r\nThen when Meteor starts up I get this error in the console:\r\n\r\n```console\r\nReferenceError: document is not defined\r\nW20161012-21:11:07.957(-7)? (STDERR)     at module.exports (/Users/******/galaxy/rigconfig/node_modules/insert-css/index.js:8:75)\r\nW20161012-21:11:07.958(-7)? (STDERR)     at Object.<anonymous> (/Users/******/galaxy/rigconfig/node_modules/react-instantsearch/src/widgets/Hits/Hits.js:36:25)\r\nW20161012-21:11:07.958(-7)? (STDERR)     at Module._compile (module.js:409:26)\r\nW20161012-21:11:07.958(-7)? (STDERR)     at Object.Module._extensions..js (module.js:416:10)\r\nW20161012-21:11:07.958(-7)? (STDERR)     at Module.load (module.js:343:32)\r\nW20161012-21:11:07.958(-7)? (STDERR)     at Module.Mp.load (/Users/******/.meteor/packages/babel-compiler/.6.9.1_1.1one49w++os+web.browser+web.cordova/npm/node_modules/reify/node/runtime.js:16:23)\r\nW20161012-21:11:07.959(-7)? (STDERR)     at Function.Module._load (module.js:300:12)\r\nW20161012-21:11:07.959(-7)? (STDERR)     at Module.require (module.js:353:17)\r\nW20161012-21:11:07.959(-7)? (STDERR)     at require (internal/module.js:12:17)\r\nW20161012-21:11:07.959(-7)? (STDERR)     at Object.<anonymous> (/Users/******/galaxy/rigconfig/node_modules/react-instantsearch/src/widgets/Hits/index.js:11:13)\r\n=> Exited with code: 1                        \r\n```\r\n\r\nAny help would be great. Thanks.\r\n\r\nPs. I haven't tried yet, but I can probably get around this for now by adding Meteor environment conditionals like `Meteor.isClient` or React lifecycle methods, etc.\r\n\r\nI was curious if there was another way, though, because I would like to try server-side rendering if possible so the initial default view is sent as plain html. Then the Algolia library takes over on the client. But this as a bit of early optimization on my part, admittedly."}}
{"actor":{"display_login":"rigconfig"}}