{"action":"created","issue":{"url":"https://api.github.com/repos/component/scroll-to/issues/9","repository_url":"https://api.github.com/repos/component/scroll-to","labels_url":"https://api.github.com/repos/component/scroll-to/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/component/scroll-to/issues/9/comments","events_url":"https://api.github.com/repos/component/scroll-to/issues/9/events","html_url":"https://github.com/component/scroll-to/issues/9","id":138068330,"number":9,"title":"Cannot find module 'tween' when requiring scroll-to server side","user":{"login":"pixelwhip","id":967665,"avatar_url":"https://avatars1.githubusercontent.com/u/967665?v=4","gravatar_id":"","url":"https://api.github.com/users/pixelwhip","html_url":"https://github.com/pixelwhip","followers_url":"https://api.github.com/users/pixelwhip/followers","following_url":"https://api.github.com/users/pixelwhip/following{/other_user}","gists_url":"https://api.github.com/users/pixelwhip/gists{/gist_id}","starred_url":"https://api.github.com/users/pixelwhip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pixelwhip/subscriptions","organizations_url":"https://api.github.com/users/pixelwhip/orgs","repos_url":"https://api.github.com/users/pixelwhip/repos","events_url":"https://api.github.com/users/pixelwhip/events{/privacy}","received_events_url":"https://api.github.com/users/pixelwhip/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-03-03T03:55:15Z","updated_at":"2018-03-09T22:09:50Z","closed_at":null,"author_association":"NONE","body":"I'm using scroll-to-element in a React app that pre-renders on the server.  When requiring scroll-to-element, which is dependent on scroll-to, I get `Error: Cannot find module 'tween'`. \n\nI believe this is because scroll-to requires `component-tween` via `var Tween = require('tween');` which works in browser environments because of the following in package.json.\n\n```\n  \"browser\": {\n    \"raf\": \"component-raf\",\n    \"tween\": \"component-tween\"\n  },\n```\n\neverything works fine in the client, but the application errors out when running on the server because node doesn't know what `tween` is.\n"},"comment":{"url":"https://api.github.com/repos/component/scroll-to/issues/comments/371959483","html_url":"https://github.com/component/scroll-to/issues/9#issuecomment-371959483","issue_url":"https://api.github.com/repos/component/scroll-to/issues/9","id":371959483,"user":{"login":"johnferrie","id":1991460,"avatar_url":"https://avatars2.githubusercontent.com/u/1991460?v=4","gravatar_id":"","url":"https://api.github.com/users/johnferrie","html_url":"https://github.com/johnferrie","followers_url":"https://api.github.com/users/johnferrie/followers","following_url":"https://api.github.com/users/johnferrie/following{/other_user}","gists_url":"https://api.github.com/users/johnferrie/gists{/gist_id}","starred_url":"https://api.github.com/users/johnferrie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnferrie/subscriptions","organizations_url":"https://api.github.com/users/johnferrie/orgs","repos_url":"https://api.github.com/users/johnferrie/repos","events_url":"https://api.github.com/users/johnferrie/events{/privacy}","received_events_url":"https://api.github.com/users/johnferrie/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T22:09:50Z","updated_at":"2018-03-09T22:09:50Z","author_association":"NONE","body":"Thanks, @fritz-c this solved it for me but I had to change `/scroll-to-element/` to `/scroll-to/` \r\n\r\n```\r\nexports.modifyWebpackConfig = ({ config, stage }) => {\r\n  if (stage === 'build-html') {\r\n    config.loader('null', {\r\n      test: /scroll-to/,\r\n      loader: 'null-loader',\r\n    });\r\n  }\r\n};\r\n```"}}
{"actor":{"display_login":"johnferrie"}}