{"action":"created","issue":{"url":"https://api.github.com/repos/keppelen/react-facebook-login/issues/4","labels_url":"https://api.github.com/repos/keppelen/react-facebook-login/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/keppelen/react-facebook-login/issues/4/comments","events_url":"https://api.github.com/repos/keppelen/react-facebook-login/issues/4/events","html_url":"https://github.com/keppelen/react-facebook-login/issues/4","id":97043848,"number":4,"title":"Error after Install","user":{"login":"thesynthetic","id":544765,"avatar_url":"https://avatars.githubusercontent.com/u/544765?v=3","gravatar_id":"","url":"https://api.github.com/users/thesynthetic","html_url":"https://github.com/thesynthetic","followers_url":"https://api.github.com/users/thesynthetic/followers","following_url":"https://api.github.com/users/thesynthetic/following{/other_user}","gists_url":"https://api.github.com/users/thesynthetic/gists{/gist_id}","starred_url":"https://api.github.com/users/thesynthetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thesynthetic/subscriptions","organizations_url":"https://api.github.com/users/thesynthetic/orgs","repos_url":"https://api.github.com/users/thesynthetic/repos","events_url":"https://api.github.com/users/thesynthetic/events{/privacy}","received_events_url":"https://api.github.com/users/thesynthetic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-24T12:40:12Z","updated_at":"2015-09-24T09:19:52Z","closed_at":null,"body":"Any idea why it can't see React variable?\r\n\r\ncument.getElementById(\"facebook-login\"))},function(e,t,n){e.exports=React},fun\r\n                                                                    ^\r\nReferenceError: React is not defined\r\n    at Object.<anonymous> (/Users/Ryeguy/Documents/Projects/Books/node_modules/react-facebook-login/dist/facebook-login.js:1:578)\r\n    at t (/Users/Ryeguy/Documents/Projects/Books/node_modules/react-facebook-login/dist/facebook-login.js:1:169)\r\n    at Object.e.exports (/Users/Ryeguy/Documents/Projects/Books/node_modules/react-facebook-login/dist/facebook-login.js:1:326)\r\n    at t (/Users/Ryeguy/Documents/Projects/Books/node_modules/react-facebook-login/dist/facebook-login.js:1:169)\r\n    at /Users/Ryeguy/Documents/Projects/Books/node_modules/react-facebook-login/dist/facebook-login.js:1:284\r\n    at Object.<anonymous> (/Users/Ryeguy/Documents/Projects/Books/node_modules/react-facebook-login/dist/facebook-login.js:1:289)\r\n    at Module._compile (module.js:460:26)\r\n    at Object.require.extensions.(anonymous function) [as .js] (/Users/Ryeguy/Documents/Projects/Books/node_modules/node-jsx/index.js:26:12)\r\n    at Module.load (module.js:355:32)\r\n    at Function.Module._load (module.js:310:12)\r\n    at Module.require (module.js:365:17)\r\n    at require (module.js:384:17)\r\n    at Object.<anonymous> (/Users/Ryeguy/Documents/Projects/Books/components/header.react.js:6:16)\r\n    at Module._compile (module.js:460:26)\r\n    at Object.require.extensions.(anonymous function) [as .js] (/Users/Ryeguy/Documents/Projects/Books/node_modules/node-jsx/index.js:26:12)\r\n    at Module.load (module.js:355:32)\r\n"},"comment":{"url":"https://api.github.com/repos/keppelen/react-facebook-login/issues/comments/142865635","html_url":"https://github.com/keppelen/react-facebook-login/issues/4#issuecomment-142865635","issue_url":"https://api.github.com/repos/keppelen/react-facebook-login/issues/4","id":142865635,"user":{"login":"danpantry","id":2939173,"avatar_url":"https://avatars.githubusercontent.com/u/2939173?v=3","gravatar_id":"","url":"https://api.github.com/users/danpantry","html_url":"https://github.com/danpantry","followers_url":"https://api.github.com/users/danpantry/followers","following_url":"https://api.github.com/users/danpantry/following{/other_user}","gists_url":"https://api.github.com/users/danpantry/gists{/gist_id}","starred_url":"https://api.github.com/users/danpantry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danpantry/subscriptions","organizations_url":"https://api.github.com/users/danpantry/orgs","repos_url":"https://api.github.com/users/danpantry/repos","events_url":"https://api.github.com/users/danpantry/events{/privacy}","received_events_url":"https://api.github.com/users/danpantry/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T09:19:51Z","updated_at":"2015-09-24T09:19:51Z","body":"This occurs because this module appears to rely on React being present in the global namespace (which it will be if loaded via browser). Obviously, this doesn't work in Node environments.\r\n\r\nThis is due to the `externals` setting in `webpack.config.js`. The way to fix is to either:\r\n\r\n- Have React exposed in the global namespace (i.e, on `window`) - This breaks isomorphism without some tricks with `jsdom`\r\n\r\nOr\r\n\r\n- Instead of exporting the webpack compilation result, run a compilation using **babel** in the `prepublish` step - skip webpack entirely - then export the resultant component file there.\r\n\r\nI'd recommend approach number 2; it's how I approached this issue.\r\n\r\nWorkaround is to use `require('react-facebook-login/facebook.jsx')`, but you'll need to enable the parsing of external modules with babel first."}}