{"action":"created","issue":{"url":"https://api.github.com/repos/zurb/foundation-sites/issues/11586","repository_url":"https://api.github.com/repos/zurb/foundation-sites","labels_url":"https://api.github.com/repos/zurb/foundation-sites/issues/11586/labels{/name}","comments_url":"https://api.github.com/repos/zurb/foundation-sites/issues/11586/comments","events_url":"https://api.github.com/repos/zurb/foundation-sites/issues/11586/events","html_url":"https://github.com/zurb/foundation-sites/issues/11586","id":380298257,"node_id":"MDU6SXNzdWUzODAyOTgyNTc=","number":11586,"title":"[REGRESSION] Calling $(document).foundation() fails in production builds","user":{"login":"josephcsible","id":16061266,"node_id":"MDQ6VXNlcjE2MDYxMjY2","avatar_url":"https://avatars0.githubusercontent.com/u/16061266?v=4","gravatar_id":"","url":"https://api.github.com/users/josephcsible","html_url":"https://github.com/josephcsible","followers_url":"https://api.github.com/users/josephcsible/followers","following_url":"https://api.github.com/users/josephcsible/following{/other_user}","gists_url":"https://api.github.com/users/josephcsible/gists{/gist_id}","starred_url":"https://api.github.com/users/josephcsible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephcsible/subscriptions","organizations_url":"https://api.github.com/users/josephcsible/orgs","repos_url":"https://api.github.com/users/josephcsible/repos","events_url":"https://api.github.com/users/josephcsible/events{/privacy}","received_events_url":"https://api.github.com/users/josephcsible/received_events","type":"User","site_admin":false},"labels":[{"id":496475516,"node_id":"MDU6TGFiZWw0OTY0NzU1MTY=","url":"https://api.github.com/repos/zurb/foundation-sites/labels/%F0%9F%9A%9A%C2%A0build","name":"🚚 build","color":"fff3ce","default":false}],"state":"open","locked":false,"assignee":{"login":"ncoden","id":9939075,"node_id":"MDQ6VXNlcjk5MzkwNzU=","avatar_url":"https://avatars2.githubusercontent.com/u/9939075?v=4","gravatar_id":"","url":"https://api.github.com/users/ncoden","html_url":"https://github.com/ncoden","followers_url":"https://api.github.com/users/ncoden/followers","following_url":"https://api.github.com/users/ncoden/following{/other_user}","gists_url":"https://api.github.com/users/ncoden/gists{/gist_id}","starred_url":"https://api.github.com/users/ncoden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncoden/subscriptions","organizations_url":"https://api.github.com/users/ncoden/orgs","repos_url":"https://api.github.com/users/ncoden/repos","events_url":"https://api.github.com/users/ncoden/events{/privacy}","received_events_url":"https://api.github.com/users/ncoden/received_events","type":"User","site_admin":false},"assignees":[{"login":"ncoden","id":9939075,"node_id":"MDQ6VXNlcjk5MzkwNzU=","avatar_url":"https://avatars2.githubusercontent.com/u/9939075?v=4","gravatar_id":"","url":"https://api.github.com/users/ncoden","html_url":"https://github.com/ncoden","followers_url":"https://api.github.com/users/ncoden/followers","following_url":"https://api.github.com/users/ncoden/following{/other_user}","gists_url":"https://api.github.com/users/ncoden/gists{/gist_id}","starred_url":"https://api.github.com/users/ncoden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncoden/subscriptions","organizations_url":"https://api.github.com/users/ncoden/orgs","repos_url":"https://api.github.com/users/ncoden/repos","events_url":"https://api.github.com/users/ncoden/events{/privacy}","received_events_url":"https://api.github.com/users/ncoden/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2018-11-13T16:00:13Z","updated_at":"2018-11-16T20:06:55Z","closed_at":null,"author_association":"NONE","body":"\r\n<!------------------------------------------------------------------------------\r\n│                  Please fill the following template.\r\n│           For more information, see the CONTRIBUTING.md document\r\n│            \r\n│       ⚠ Only submit bug reports here. For help or questions to the\r\n│       community, see the forum: https://foundation.zurb.com/forum\r\n└------------------------------------------------------------------------------>\r\n\r\n## What should happen?\r\n\r\nCalling `$(document).foundation()` in production React app builds should work, as it did in Foundation 6.5.0-rc.2.\r\n\r\n\r\n## What happens instead?\r\n\r\nCalling `$(document).foundation()` in production React app builds results in an error like `TypeError: w(...)(...).foundation is not a function`.\r\n\r\n\r\n## Test Case and/or Steps to Reproduce (for bugs)\r\n<!-------------------------------------------------------------------\r\n│   If you cannot provide a test case, provide an unambiguous set\r\n│   of steps to reproduce, with your code and configuration.\r\n└------------------------------------------------------------------->\r\nHow to reproduce:\r\n1. Run `npx create-react-app my-app`\r\n2. Run `cd my-app`\r\n3. Run `yarn add jquery foundation-sites@6.5.0`\r\n4. Add `import 'foundation-sites';`, `import $ from 'jquery';`, and `$(document).foundation();` to `src/index.js`\r\n5. Run `yarn build`\r\n6. Run `yarn global add serve`\r\n7. Run `serve -s build`\r\n8. Visit http://localhost:5000\r\n9. Look in the browser console\r\n\r\n\r\n## Context\r\n<!-------------------------------------------------------------------\r\n│   [Optional] How has this issue affected you? What are you trying\r\n│   to accomplish? Providing context helps us come up with a solution\r\n│   that is most useful in the real world.\r\n└------------------------------------------------------------------->\r\n\r\nI’d like to be able to use the latest version of Foundation in a production React app. This is a regression, as my reproduction steps don't cause the error with Foundation 6.5.0-rc.2. Also, the error only occurs in production builds, not in development (which you can see by doing `yarn start` in place of steps 5, 6, and 7, and then going to http://localhost:3000).\r\n\r\n\r\n## Your Environment\r\n<!-------------------------------------------------------------------\r\n│   Include as many relevant details about the context and environment\r\n│   you experienced the bug in. You can also provide logs.\r\n└------------------------------------------------------------------->\r\n- Foundation version(s) used: 6.5.0\r\n- Browser(s) name and version(s): Firefox 60.2.0esr, Chrome 70.0.3538.102\r\n- Device, Operating System and version: Tested in Docker container `node:10-alpine`\r\n- Link to your project: N/A\r\n\r\n\r\n## Checklist\r\n<!-------------------------------------------------------------------\r\n│   Please ensure that all the following points are respected.\r\n│   Fill with [x] the boxes once the rule is respected.\r\n└------------------------------------------------------------------->\r\n- [x] I have read and follow the CONTRIBUTING.md document.\r\n- [x] There are no other issues similar to this one.\r\n- [x] The issue title and template are correctly filled.\r\n\r\n\r\n<!------------------------------------------------------------------------------\r\n            For more information, see the CONTRIBUTING.md document\r\n              Thank you for your pull request and happy coding ;)\r\n------------------------------------------------------------------------------->"},"comment":{"url":"https://api.github.com/repos/zurb/foundation-sites/issues/comments/439511756","html_url":"https://github.com/zurb/foundation-sites/issues/11586#issuecomment-439511756","issue_url":"https://api.github.com/repos/zurb/foundation-sites/issues/11586","id":439511756,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTUxMTc1Ng==","user":{"login":"ncoden","id":9939075,"node_id":"MDQ6VXNlcjk5MzkwNzU=","avatar_url":"https://avatars2.githubusercontent.com/u/9939075?v=4","gravatar_id":"","url":"https://api.github.com/users/ncoden","html_url":"https://github.com/ncoden","followers_url":"https://api.github.com/users/ncoden/followers","following_url":"https://api.github.com/users/ncoden/following{/other_user}","gists_url":"https://api.github.com/users/ncoden/gists{/gist_id}","starred_url":"https://api.github.com/users/ncoden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncoden/subscriptions","organizations_url":"https://api.github.com/users/ncoden/orgs","repos_url":"https://api.github.com/users/ncoden/repos","events_url":"https://api.github.com/users/ncoden/events{/privacy}","received_events_url":"https://api.github.com/users/ncoden/received_events","type":"User","site_admin":false},"created_at":"2018-11-16T20:06:55Z","updated_at":"2018-11-16T20:06:55Z","author_association":"MEMBER","body":"I keep this issue open because there is at least the documentation to update."}}
{"actor":{"display_login":"ncoden"}}