{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular-cli/issues/12148","repository_url":"https://api.github.com/repos/angular/angular-cli","labels_url":"https://api.github.com/repos/angular/angular-cli/issues/12148/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular-cli/issues/12148/comments","events_url":"https://api.github.com/repos/angular/angular-cli/issues/12148/events","html_url":"https://github.com/angular/angular-cli/issues/12148","id":357011581,"node_id":"MDU6SXNzdWUzNTcwMTE1ODE=","number":12148,"title":"For polyfill es7/reflect, it should be mentioned that tests are not run in AOT mode","user":{"login":"alexeagle","id":47395,"node_id":"MDQ6VXNlcjQ3Mzk1","avatar_url":"https://avatars2.githubusercontent.com/u/47395?v=4","gravatar_id":"","url":"https://api.github.com/users/alexeagle","html_url":"https://github.com/alexeagle","followers_url":"https://api.github.com/users/alexeagle/followers","following_url":"https://api.github.com/users/alexeagle/following{/other_user}","gists_url":"https://api.github.com/users/alexeagle/gists{/gist_id}","starred_url":"https://api.github.com/users/alexeagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexeagle/subscriptions","organizations_url":"https://api.github.com/users/alexeagle/orgs","repos_url":"https://api.github.com/users/alexeagle/repos","events_url":"https://api.github.com/users/alexeagle/events{/privacy}","received_events_url":"https://api.github.com/users/alexeagle/received_events","type":"User","site_admin":false},"labels":[{"id":815674896,"node_id":"MDU6TGFiZWw4MTU2NzQ4OTY=","url":"https://api.github.com/repos/angular/angular-cli/labels/comp:%20schematics/angular","name":"comp: schematics/angular","color":"c7def8","default":false},{"id":394042938,"node_id":"MDU6TGFiZWwzOTQwNDI5Mzg=","url":"https://api.github.com/repos/angular/angular-cli/labels/type:%20docs","name":"type: docs","color":"EEEEEE","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/angular/angular-cli/milestones/12","html_url":"https://github.com/angular/angular-cli/milestone/12","labels_url":"https://api.github.com/repos/angular/angular-cli/milestones/12/labels","id":3561109,"node_id":"MDk6TWlsZXN0b25lMzU2MTEwOQ==","number":12,"title":"Backlog","description":"Milestone for triaged issues that have not yet been scheduled for resolution.","creator":{"login":"alexeagle","id":47395,"node_id":"MDQ6VXNlcjQ3Mzk1","avatar_url":"https://avatars2.githubusercontent.com/u/47395?v=4","gravatar_id":"","url":"https://api.github.com/users/alexeagle","html_url":"https://github.com/alexeagle","followers_url":"https://api.github.com/users/alexeagle/followers","following_url":"https://api.github.com/users/alexeagle/following{/other_user}","gists_url":"https://api.github.com/users/alexeagle/gists{/gist_id}","starred_url":"https://api.github.com/users/alexeagle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexeagle/subscriptions","organizations_url":"https://api.github.com/users/alexeagle/orgs","repos_url":"https://api.github.com/users/alexeagle/repos","events_url":"https://api.github.com/users/alexeagle/events{/privacy}","received_events_url":"https://api.github.com/users/alexeagle/received_events","type":"User","site_admin":false},"open_issues":104,"closed_issues":92,"state":"open","created_at":"2018-08-10T14:47:31Z","updated_at":"2018-11-05T21:55:54Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-09-04T23:26:13Z","updated_at":"2018-11-06T01:19:07Z","closed_at":null,"author_association":"COLLABORATOR","body":"_From @fredgate on January 25, 2018 11:7_\n\n### Bug Report or Feature Request (mark with an `x`)\r\n```\r\n- [x] bug report -> please search issues before submitting\r\n- [ ] feature request\r\n```\r\n\r\n### Area\r\n```\r\n- [ ] devkit\r\n- [x] schematics\r\n```\r\n\r\n### Versions\r\nangular CLI 1.6.4\r\n\r\n\r\n### Repro steps\r\nUse AOT to serve and build the application.\r\n\r\nIn the `polyfills.ts` file, comment the `import 'core-js/es7/reflect';` line as it is mentioned that :\r\n```\r\n/** Evergreen browsers require these. **/\r\n// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.\r\n// import 'core-js/es7/reflect';\r\n```\r\n\r\nThen execute unit tests. Tests where a provider (the system under test, or any other class) has a injected dependency will fail with a message indicating that it can resolve all parameter for the class. It is not because its dependencies are not registered in the testing module, but because it can not read metadata of the class and so determine the dependant classes.\r\n\r\n### The log given by the failure\r\n```\r\nError: Can't resolve all parameters for MyService: (?). in http://localhost:9876/_karma_webpack_/vendor.bundle.js (line 20595)\r\nsyntaxError@http://localhost:9876/_karma_webpack_/vendor.bundle.js:20595:34\r\n../../../compiler/esm5/compiler.js/CompileMetadataResolver.prototype._getDependenciesMetadata@http://localhost:9876/_karma_webpack_/vendor.bundle.js:35802:35\r\n```\r\n\r\n### Desired functionality\r\nThe `polyfills.ts` should mention for the _es7/reflect_ polyfill that unit tests are not run in AOT mode.\r\n\n\n_Copied from original issue: angular/devkit#408_"},"comment":{"url":"https://api.github.com/repos/angular/angular-cli/issues/comments/436096654","html_url":"https://github.com/angular/angular-cli/issues/12148#issuecomment-436096654","issue_url":"https://api.github.com/repos/angular/angular-cli/issues/12148","id":436096654,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjA5NjY1NA==","user":{"login":"leonardochaia","id":7344715,"node_id":"MDQ6VXNlcjczNDQ3MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/7344715?v=4","gravatar_id":"","url":"https://api.github.com/users/leonardochaia","html_url":"https://github.com/leonardochaia","followers_url":"https://api.github.com/users/leonardochaia/followers","following_url":"https://api.github.com/users/leonardochaia/following{/other_user}","gists_url":"https://api.github.com/users/leonardochaia/gists{/gist_id}","starred_url":"https://api.github.com/users/leonardochaia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonardochaia/subscriptions","organizations_url":"https://api.github.com/users/leonardochaia/orgs","repos_url":"https://api.github.com/users/leonardochaia/repos","events_url":"https://api.github.com/users/leonardochaia/events{/privacy}","received_events_url":"https://api.github.com/users/leonardochaia/received_events","type":"User","site_admin":false},"created_at":"2018-11-06T01:19:07Z","updated_at":"2018-11-06T01:19:07Z","author_association":"NONE","body":"@moniuch in my scenario [I'm using the ReflectiveInjector](https://github.com/leonardochaia/timoneer/blob/d7a0f34d7832b6200f545285627e7831b4bd431c/src/app/jobs/job-runner.service.ts#L32) and [custom decorators](https://github.com/leonardochaia/timoneer/blob/d7a0f34d7832b6200f545285627e7831b4bd431c/src/app/jobs/job.decorator.ts#L5) which requires the Reflect API. My prod builds got broken after upgrading to Angular 7\r\n\r\nI managed to fix it by [adding the polyfill back](https://github.com/leonardochaia/timoneer/commit/263ef6ca896ea8676be24b294c128559fe238449)(that was removed by the CLI when I did the update)\r\n\r\nNote that the CLI entirely removes the line (instead of commenting it)\r\n```typescript\r\n/** Evergreen browsers require these. **/\r\n// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.\r\nimport 'core-js/es7/reflect'; \r\n```\r\n\r\nAs a side note, a similar line remains commented, which confused me at first:\r\n```typescript\r\n/** IE10 and IE11 requires the following for the Reflect API. */\r\n// import 'core-js/es6/reflect';\r\n```\r\n\r\n(Note the `es6` vs `es7`) \r\nadding/removing the `es6` line had no effect for me, apparently I need the `es7` one.\r\n"}}
{"actor":{"display_login":"leonardochaia"}}