{"action":"closed","issue":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/525","repository_url":"https://api.github.com/repos/facebookincubator/create-react-app","labels_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/525/labels{/name}","comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/525/comments","events_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/525/events","html_url":"https://github.com/facebookincubator/create-react-app/issues/525","id":174290353,"number":525,"title":"Bug issue with babel-plugin-transform-react-constant-elements","user":{"login":"velopert","id":17202261,"avatar_url":"https://avatars.githubusercontent.com/u/17202261?v=3","gravatar_id":"","url":"https://api.github.com/users/velopert","html_url":"https://github.com/velopert","followers_url":"https://api.github.com/users/velopert/followers","following_url":"https://api.github.com/users/velopert/following{/other_user}","gists_url":"https://api.github.com/users/velopert/gists{/gist_id}","starred_url":"https://api.github.com/users/velopert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/velopert/subscriptions","organizations_url":"https://api.github.com/users/velopert/orgs","repos_url":"https://api.github.com/users/velopert/repos","events_url":"https://api.github.com/users/velopert/events{/privacy}","received_events_url":"https://api.github.com/users/velopert/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebookincubator/create-react-app/labels/bug","name":"bug","color":"ee0701"},{"url":"https://api.github.com/repos/facebookincubator/create-react-app/labels/underlying%20tools","name":"underlying tools","color":"d93f0b"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-31T14:36:13Z","updated_at":"2016-09-02T21:10:29Z","closed_at":"2016-09-02T21:10:29Z","body":"When I work on my React  Project, I usually put the component files in a directory and create a index.js so that I can load the components like `import { UserInfo, AnotherComponent } from 'container';` \r\n\r\nToday, I tried using that structure with create-react-app. It works perfectly on the dev-server, but it gives following error when I try to load the component:\r\n \r\n```\r\nReact: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.\r\n```\r\n\r\n\r\nMy have uploaded the directory structure and codes on gist: https://gist.github.com/velopert/ab6e132d73a17930c90e3e38493c12ed\r\n\r\nIt seems like there's no problem if I import and render the components from outside of the directory. \r\n(For example, I can import and render App component from src/index.js, if I do not render UserInfo from App component). I tried console.log(<UserInfo/>) from App, and it seems like there is no problem with importing the module. I think there is an issue with rendering it.\r\n\r\nAnyways, I just have found out that the `babel-plugin-transform-react-constant-elements` is the one that causes problem. I commented out the `babel-plugin-transform-react-constant-elements` part from the babel.prod.js and it works fine again.\r\n\r\nThanks !"}}
{"actor":{"display_login":"gaearon"}}