{"action":"created","issue":{"url":"https://api.github.com/repos/kadirahq/flow-router/issues/549","repository_url":"https://api.github.com/repos/kadirahq/flow-router","labels_url":"https://api.github.com/repos/kadirahq/flow-router/issues/549/labels{/name}","comments_url":"https://api.github.com/repos/kadirahq/flow-router/issues/549/comments","events_url":"https://api.github.com/repos/kadirahq/flow-router/issues/549/events","html_url":"https://github.com/kadirahq/flow-router/issues/549","id":138558770,"number":549,"title":"[question] What is the proper way to avoid document is not defined while using SSR?","user":{"login":"sammkj","id":9153498,"avatar_url":"https://avatars.githubusercontent.com/u/9153498?v=3","gravatar_id":"","url":"https://api.github.com/users/sammkj","html_url":"https://github.com/sammkj","followers_url":"https://api.github.com/users/sammkj/followers","following_url":"https://api.github.com/users/sammkj/following{/other_user}","gists_url":"https://api.github.com/users/sammkj/gists{/gist_id}","starred_url":"https://api.github.com/users/sammkj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sammkj/subscriptions","organizations_url":"https://api.github.com/users/sammkj/orgs","repos_url":"https://api.github.com/users/sammkj/repos","events_url":"https://api.github.com/users/sammkj/events{/privacy}","received_events_url":"https://api.github.com/users/sammkj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-03-04T19:09:08Z","updated_at":"2016-11-20T07:11:45Z","closed_at":null,"body":"I tried\n\n(1) putting my code in `componentDidMount()`\n(2) wrapping my component in `<NoSSR> <!--component--> </NoSSR>`\n\nI got this error:\n\n```\nReferenceError: document is not defined\nW20160304-13:00:43.407(-6)? (STDERR)     at node_modules/node-waves/src/js/waves.js:35:1\nW20160304-13:00:43.407(-6)? (STDERR)     at Waves (node_modules/node-waves/src/js/waves.js:24:1)\nW20160304-13:00:43.407(-6)? (STDERR)     at meteorInstall.node_modules.node-waves.src.js.waves.js (node_modules/node-waves/src/js/waves.js:31:1)\nW20160304-13:00:43.407(-6)? (STDERR)     at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:202:1)\nW20160304-13:00:43.407(-6)? (STDERR)     at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:75:1)\nW20160304-13:00:43.407(-6)? (STDERR)     at meteorInstall.app.imports.modules.core.components.button.jsx (/home/skaxwng/code/easy-make/app/.meteor/local/build/programs/server/app/app.js:1291:18)\nW20160304-13:00:43.407(-6)? (STDERR)     at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:202:1)\nW20160304-13:00:43.408(-6)? (STDERR)     at require (packages/modules-runtime/.npm/package/node_modules/install/install.js:75:1)\nW20160304-13:00:43.408(-6)? (STDERR)     at meteorInstall.app.imports.modules.core.components.js (app/imports/modules/core/reducers/index.js:3:16)\nW20160304-13:00:43.408(-6)? (STDERR)     at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:202:1)\n```\n\nHowever, if I do this in my component:\n\n```\ncomponentDidMount() {\n    const Waves = require('node-waves');\n    Waves.init();\n    Waves.attach(this.refs.button);\n  }\n```\n\nEverything works fine. I wonder if there's a better and proper way to deal with this?\n"},"comment":{"url":"https://api.github.com/repos/kadirahq/flow-router/issues/comments/261763028","html_url":"https://github.com/kadirahq/flow-router/issues/549#issuecomment-261763028","issue_url":"https://api.github.com/repos/kadirahq/flow-router/issues/549","id":261763028,"user":{"login":"leanhducvt","id":3524016,"avatar_url":"https://avatars.githubusercontent.com/u/3524016?v=3","gravatar_id":"","url":"https://api.github.com/users/leanhducvt","html_url":"https://github.com/leanhducvt","followers_url":"https://api.github.com/users/leanhducvt/followers","following_url":"https://api.github.com/users/leanhducvt/following{/other_user}","gists_url":"https://api.github.com/users/leanhducvt/gists{/gist_id}","starred_url":"https://api.github.com/users/leanhducvt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leanhducvt/subscriptions","organizations_url":"https://api.github.com/users/leanhducvt/orgs","repos_url":"https://api.github.com/users/leanhducvt/repos","events_url":"https://api.github.com/users/leanhducvt/events{/privacy}","received_events_url":"https://api.github.com/users/leanhducvt/received_events","type":"User","site_admin":false},"created_at":"2016-11-20T07:11:45Z","updated_at":"2016-11-20T07:11:45Z","body":"I've got this same issue."}}
{"actor":{"display_login":"leanhducvt"}}