{"action":"created","issue":{"url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/144","labels_url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/144/comments","events_url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/144/events","html_url":"https://github.com/terinjokes/gulp-uglify/issues/144","id":113761321,"number":144,"title":"gulp-uglify expects an object, non-object provided","user":{"login":"alayek","id":5607371,"avatar_url":"https://avatars.githubusercontent.com/u/5607371?v=3","gravatar_id":"","url":"https://api.github.com/users/alayek","html_url":"https://github.com/alayek","followers_url":"https://api.github.com/users/alayek/followers","following_url":"https://api.github.com/users/alayek/following{/other_user}","gists_url":"https://api.github.com/users/alayek/gists{/gist_id}","starred_url":"https://api.github.com/users/alayek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alayek/subscriptions","organizations_url":"https://api.github.com/users/alayek/orgs","repos_url":"https://api.github.com/users/alayek/repos","events_url":"https://api.github.com/users/alayek/events{/privacy}","received_events_url":"https://api.github.com/users/alayek/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/terinjokes/gulp-uglify/labels/support","name":"support","color":"FF91AF"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-28T07:44:50Z","updated_at":"2015-10-28T10:22:54Z","closed_at":"2015-10-28T10:09:31Z","body":"Hi, I installed `gulp-uglify` today using `npm i --save-dev gulp-uglify`.\r\n\r\nI followed this tutorial http://tylermcginnis.com/reactjs-tutorial-pt-2-building-react-applications-with-gulp-and-browserify/ to use `gulp-uglify` like this:\r\n\r\n```\r\ngulp.task('build', function(){\r\n  gulp.src(path.JS)\r\n    .pipe(react())\r\n    .pipe(concat(path.MINIFIED_OUT))\r\n    .pipe(uglify(path.MINIFIED_OUT))\r\n    .pipe(gulp.dest(path.DEST_BUILD));\r\n});\r\n```\r\nWhen I run `gulp build` in my terminal, I get this error message :\r\n`gulp-uglify expects an object, non-object provided`\r\n\r\nIt was not necessarily an error message, the command exited with status 0.\r\n\r\nWhen I loaded my `index.html` in browser, in console, I saw this error: `Uncaught TypeError: e.type is not a function`\r\n\r\nI realize something has gone wrong in the uglification process. My `package.json` shows `\"gulp-uglify\": \"^1.4.2\"`.\r\n\r\nPlease help. How should I be calling the `uglify` function in gulp task? I checked the documentation in npmjs website, and all I could find was the `uglify()` function was being called without any argumment. But that won't be applicable here, since I want them to go to a different directory.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/comments/151792583","html_url":"https://github.com/terinjokes/gulp-uglify/issues/144#issuecomment-151792583","issue_url":"https://api.github.com/repos/terinjokes/gulp-uglify/issues/144","id":151792583,"user":{"login":"alayek","id":5607371,"avatar_url":"https://avatars.githubusercontent.com/u/5607371?v=3","gravatar_id":"","url":"https://api.github.com/users/alayek","html_url":"https://github.com/alayek","followers_url":"https://api.github.com/users/alayek/followers","following_url":"https://api.github.com/users/alayek/following{/other_user}","gists_url":"https://api.github.com/users/alayek/gists{/gist_id}","starred_url":"https://api.github.com/users/alayek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alayek/subscriptions","organizations_url":"https://api.github.com/users/alayek/orgs","repos_url":"https://api.github.com/users/alayek/repos","events_url":"https://api.github.com/users/alayek/events{/privacy}","received_events_url":"https://api.github.com/users/alayek/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T10:22:54Z","updated_at":"2015-10-28T10:22:54Z","body":"Hello @terinjokes, here are a few other things I have tried since filing this issue:\r\n\r\nI used \r\n```\r\n.pipe(uglify({ \r\n            file:path.MINIFIED_OUT \r\n        }))\r\n```\r\n\r\nThis took away the error message with latest gulp in the terminal. But the React components are still not being rendered. in browser console, I am getting the same error message.\r\n\r\nIn uninstalled latest `gulp-uglify` and reinstalled `gulp-uglify@1.1.0` and used it as provided in the tutorial.\r\n\r\nStill the same thing - uglification succeeds, but the JS code fails in browser.\r\n\r\nI removed the uglification step altogether, and it produced the following output:\r\n\r\n```\r\nReact.render(React.createElement(Parent, null), document.getElementById('app'));\r\nvar Child = React.createClass({displayName: \"Child\",\r\n    propTypes: function() {\r\n        name: React.PropTypes.String.isRequired\r\n    },\r\n\r\n    render: function(){\r\n        return (\r\n            React.createElement(\"div\", null, \r\n                \"and this is the \", React.createElement(\"b\", null, this.props.name), \".\"\r\n            )\r\n        );\r\n    }\r\n});\r\nvar Parent = React.createClass({displayName: \"Parent\",\r\n    render: function(){\r\n        return (\r\n            React.createElement(\"div\", null, \r\n                React.createElement(\"div\", null, \" This is the parent. \"), \r\n                React.createElement(Child, {name: \"child\"})\r\n            )\r\n        );\r\n    }\r\n});\r\n```\r\n\r\nThis one renders the React components just fine. So, my original JS code is fine, and the concatenation works too. But the uglification step messes up something, and the react.min.js cannot render my components."}}