{"action":"created","issue":{"url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/359","repository_url":"https://api.github.com/repos/SharePoint/PnP-JS-Core","labels_url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/359/labels{/name}","comments_url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/359/comments","events_url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/359/events","html_url":"https://github.com/SharePoint/PnP-JS-Core/issues/359","id":213173737,"number":359,"title":"UglifyJs Error while building Angular 2(Angular-cli) project in Production mode using sp-pnp-js package","user":{"login":"sraddhan","id":5920253,"avatar_url":"https://avatars0.githubusercontent.com/u/5920253?v=3","gravatar_id":"","url":"https://api.github.com/users/sraddhan","html_url":"https://github.com/sraddhan","followers_url":"https://api.github.com/users/sraddhan/followers","following_url":"https://api.github.com/users/sraddhan/following{/other_user}","gists_url":"https://api.github.com/users/sraddhan/gists{/gist_id}","starred_url":"https://api.github.com/users/sraddhan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sraddhan/subscriptions","organizations_url":"https://api.github.com/users/sraddhan/orgs","repos_url":"https://api.github.com/users/sraddhan/repos","events_url":"https://api.github.com/users/sraddhan/events{/privacy}","received_events_url":"https://api.github.com/users/sraddhan/received_events","type":"User","site_admin":false},"labels":[{"id":336234980,"url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/labels/duplicate","name":"duplicate","color":"cccccc","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-09T21:39:33Z","updated_at":"2017-03-10T12:55:32Z","closed_at":"2017-03-09T21:48:29Z","body":"#### Category\r\n[ ] Enhancement\r\n\r\n[x] Bug\r\n\r\n[ ] Question\r\n\r\n#### Expected / Desired Behavior / Question\r\n\"ng build --prod\" should bundle the project successfully and should generate \"dist\" folder.\r\n\r\n#### Observed Behavior\r\nWorks great in development mode i.e. \"ng build\" works great. \r\nBut when Angular 2 project is built using the command \"ng build --prod\", it errors out.\r\n\r\n**Error Message**  \r\n\"ERROR in vendor.c71699387434c14250a9.bundle.js from UglifyJs\r\nSyntaxError: Unexpected token: name (CachedDigest) [vendor.c71699387434c14250a9.bundle.js:265,6]\"\r\n\r\n\r\n#### Steps to Reproduce\r\n1. Download and npm install \"angular-cli\" ([link](https://www.npmjs.com/package/angular-cli))\r\n2. Follow the steps on README.md file on angular-cli to generate an angular 2 application.\r\n3. npm install sp-pnp-js \r\n4. Use sp-pnp-js in the service -> import * as sp from 'sp-pnp-js'; \r\n5. Build the project with command \"ng build\" as suggested in angular-cli -> this should be successful\r\n6. Now, build the project using command \"ng build --prod\". This is where error should appear. \r\n\r\nOR \r\n\r\n1. clone [this](https://github.com/sraddhan/ng2Forms.git) repository.\r\n2. checkout to tag v0.1\r\n3. run \"npm install\"\r\n4. run \"ng build --prod\"\r\n\r\nNotice, removing the import * as sp from 'sp-pnp-js' and commenting related code will let build successfully. \r\n\r\n#### Submission Guidelines\r\nNA\r\n\r\n\r\n\r\n\r\nThanks!\r\n"},"comment":{"url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/comments/285662472","html_url":"https://github.com/SharePoint/PnP-JS-Core/issues/359#issuecomment-285662472","issue_url":"https://api.github.com/repos/SharePoint/PnP-JS-Core/issues/359","id":285662472,"user":{"login":"olemp","id":7606007,"avatar_url":"https://avatars3.githubusercontent.com/u/7606007?v=3","gravatar_id":"","url":"https://api.github.com/users/olemp","html_url":"https://github.com/olemp","followers_url":"https://api.github.com/users/olemp/followers","following_url":"https://api.github.com/users/olemp/following{/other_user}","gists_url":"https://api.github.com/users/olemp/gists{/gist_id}","starred_url":"https://api.github.com/users/olemp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olemp/subscriptions","organizations_url":"https://api.github.com/users/olemp/orgs","repos_url":"https://api.github.com/users/olemp/repos","events_url":"https://api.github.com/users/olemp/events{/privacy}","received_events_url":"https://api.github.com/users/olemp/received_events","type":"User","site_admin":false},"created_at":"2017-03-10T12:55:32Z","updated_at":"2017-03-10T12:55:32Z","body":"Lovely @patrick-rodgers!"}}
{"actor":{"display_login":"olemp"}}