{"action":"created","issue":{"url":"https://api.github.com/repos/jvandemo/generator-angular2-library/issues/75","repository_url":"https://api.github.com/repos/jvandemo/generator-angular2-library","labels_url":"https://api.github.com/repos/jvandemo/generator-angular2-library/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/jvandemo/generator-angular2-library/issues/75/comments","events_url":"https://api.github.com/repos/jvandemo/generator-angular2-library/issues/75/events","html_url":"https://github.com/jvandemo/generator-angular2-library/issues/75","id":223920518,"number":75,"title":"Scoped packages throw compilation errors","user":{"login":"jdjuan","id":3171900,"avatar_url":"https://avatars3.githubusercontent.com/u/3171900?v=3","gravatar_id":"","url":"https://api.github.com/users/jdjuan","html_url":"https://github.com/jdjuan","followers_url":"https://api.github.com/users/jdjuan/followers","following_url":"https://api.github.com/users/jdjuan/following{/other_user}","gists_url":"https://api.github.com/users/jdjuan/gists{/gist_id}","starred_url":"https://api.github.com/users/jdjuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdjuan/subscriptions","organizations_url":"https://api.github.com/users/jdjuan/orgs","repos_url":"https://api.github.com/users/jdjuan/repos","events_url":"https://api.github.com/users/jdjuan/events{/privacy}","received_events_url":"https://api.github.com/users/jdjuan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-24T19:05:13Z","updated_at":"2017-04-25T02:49:43Z","closed_at":"2017-04-24T21:00:58Z","body":"When I try to compile an application for production that uses a library which has an NPM scope, it throws errors and fails.\r\n\r\n# Reproduction Steps\r\n\r\n1. Create a new library: `mkdir lib`, `cd lib`, and `yo angular2-library`\r\n2. Generate a new clean angular app with angular-cli: `ng new app-seed`\r\n4. Modify your library `package.json` (the one in `src`, or the `dist` folder) to be scoped: `\"name\": \"@aaa/lib\",`\r\n5. Perform an `NPM link` of your library: `npm link` and then inside your app: `npm link @aaa/lib`\r\n6. Run `ng build --prod --aot` and see the console error below. Commands `ng serve` and `ng build` work well.\r\n\r\nYou can also clone this [repo](https://github.com/jdjuan/ng-library-scope-issue) and jump to step 3.\r\n\r\n## Error\r\n\r\n```\r\nERROR in C:/Users/jherrera/repos/PROD-ISSUE3/app-seed/src/$$_gendir/app/app.component.ngfactory.ts (1,1): Cannot find module 'lib'.\r\n\r\nERROR in C:/Users/jherrera/repos/PROD-ISSUE3/app-seed/src/$$_gendir/node_modules/@aaa/lib/lib.ngfactory.ts (1,1): Cannot find module 'lib'.\r\n\r\nERROR in C:/Users/jherrera/repos/PROD-ISSUE3/app-seed/src/$$_gendir/app/app.module.ngfactory.ts (1,1): Cannot find module 'lib'.\r\n\r\nERROR in C:/Users/jherrera/repos/PROD-ISSUE3/app-seed/src/$$_gendir/app/app.module.ngfactory.ts (1,1): Cannot find module 'lib'.\r\n\r\nERROR in C:/Users/jherrera/repos/PROD-ISSUE3/app-seed/src/$$_gendir/app/app.component.ngfactory.ts (1,1): Cannot find module 'lib'.\r\n\r\nERROR in ./src/$$_gendir/app/app.module.ngfactory.ts\r\nModule not found: Error: Can't resolve 'lib' in 'C:\\Users\\jherrera\\repos\\PROD-ISSUE3\\app-seed\\src\\$$_gendir\\app'\r\n @ ./src/$$_gendir/app/app.module.ngfactory.ts 23:0-31\r\n @ ./src/main.ts\r\n @ multi ./src/main.ts\r\n\r\nERROR in ./src/$$_gendir/app/app.component.ngfactory.ts\r\nModule not found: Error: Can't resolve 'lib' in 'C:\\Users\\jherrera\\repos\\PROD-ISSUE3\\app-seed\\src\\$$_gendir\\app'\r\n @ ./src/$$_gendir/app/app.component.ngfactory.ts 10:0-31\r\n @ ./src/$$_gendir/app/app.module.ngfactory.ts\r\n @ ./src/main.ts\r\n @ multi ./src/main.ts\r\n\r\nERROR in C:/Users/jherrera/repos/PROD-ISSUE3/app-seed/src/$$_gendir/node_modules/@aaa/lib/lib.ngfactory.ts (1,1): Cannot find module 'lib'.\r\n\r\nERROR in ./src/$$_gendir/~/@aaa/lib/lib.ngfactory.ts\r\nModule not found: Error: Can't resolve 'lib' in 'C:\\Users\\jherrera\\repos\\PROD-ISSUE3\\app-seed\\src\\$$_gendir\\node_modules\\@aaa\\lib'\r\n @ ./src/$$_gendir/~/@aaa/lib/lib.ngfactory.ts 18:0-31\r\n @ ./src/$$_gendir/app/app.component.ngfactory.ts\r\n @ ./src/$$_gendir/app/app.module.ngfactory.ts\r\n @ ./src/main.ts\r\n @ multi ./src/main.ts\r\n```\r\n\r\n## Environment\r\n\r\n- NPM: 4.5.0\r\n- Node: 7.9.0\r\n- Angular CLI: 1.0.0\r\n- Generator-angular2-libary: 9.0.0\r\n- OS: Windows 10"},"comment":{"url":"https://api.github.com/repos/jvandemo/generator-angular2-library/issues/comments/296877634","html_url":"https://github.com/jvandemo/generator-angular2-library/issues/75#issuecomment-296877634","issue_url":"https://api.github.com/repos/jvandemo/generator-angular2-library/issues/75","id":296877634,"user":{"login":"jvandemo","id":1859381,"avatar_url":"https://avatars0.githubusercontent.com/u/1859381?v=3","gravatar_id":"","url":"https://api.github.com/users/jvandemo","html_url":"https://github.com/jvandemo","followers_url":"https://api.github.com/users/jvandemo/followers","following_url":"https://api.github.com/users/jvandemo/following{/other_user}","gists_url":"https://api.github.com/users/jvandemo/gists{/gist_id}","starred_url":"https://api.github.com/users/jvandemo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvandemo/subscriptions","organizations_url":"https://api.github.com/users/jvandemo/orgs","repos_url":"https://api.github.com/users/jvandemo/repos","events_url":"https://api.github.com/users/jvandemo/events{/privacy}","received_events_url":"https://api.github.com/users/jvandemo/received_events","type":"User","site_admin":false},"created_at":"2017-04-25T02:49:43Z","updated_at":"2017-04-25T02:49:43Z","body":"@jdjuan &mdash; Thank you for your follow-up, Juan. Much appreciated! 🏆 \r\n\r\nI have added a section to the README with instructions and a link to this issue.\r\n"}}
{"actor":{"display_login":"jvandemo"}}