{"action":"created","issue":{"url":"https://api.github.com/repos/mgechev/angular-seed/issues/1763","repository_url":"https://api.github.com/repos/mgechev/angular-seed","labels_url":"https://api.github.com/repos/mgechev/angular-seed/issues/1763/labels{/name}","comments_url":"https://api.github.com/repos/mgechev/angular-seed/issues/1763/comments","events_url":"https://api.github.com/repos/mgechev/angular-seed/issues/1763/events","html_url":"https://github.com/mgechev/angular-seed/issues/1763","id":200551525,"number":1763,"title":"AoT compile fails when using ambient TSDs","user":{"login":"brian428","id":140338,"avatar_url":"https://avatars.githubusercontent.com/u/140338?v=3","gravatar_id":"","url":"https://api.github.com/users/brian428","html_url":"https://github.com/brian428","followers_url":"https://api.github.com/users/brian428/followers","following_url":"https://api.github.com/users/brian428/following{/other_user}","gists_url":"https://api.github.com/users/brian428/gists{/gist_id}","starred_url":"https://api.github.com/users/brian428/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brian428/subscriptions","organizations_url":"https://api.github.com/users/brian428/orgs","repos_url":"https://api.github.com/users/brian428/repos","events_url":"https://api.github.com/users/brian428/events{/privacy}","received_events_url":"https://api.github.com/users/brian428/received_events","type":"User","site_admin":false},"labels":[{"id":190348493,"url":"https://api.github.com/repos/mgechev/angular-seed/labels/bug","name":"bug","color":"fc2929","default":true},{"id":295486529,"url":"https://api.github.com/repos/mgechev/angular-seed/labels/P2","name":"P2","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"mgechev","id":455023,"avatar_url":"https://avatars.githubusercontent.com/u/455023?v=3","gravatar_id":"","url":"https://api.github.com/users/mgechev","html_url":"https://github.com/mgechev","followers_url":"https://api.github.com/users/mgechev/followers","following_url":"https://api.github.com/users/mgechev/following{/other_user}","gists_url":"https://api.github.com/users/mgechev/gists{/gist_id}","starred_url":"https://api.github.com/users/mgechev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgechev/subscriptions","organizations_url":"https://api.github.com/users/mgechev/orgs","repos_url":"https://api.github.com/users/mgechev/repos","events_url":"https://api.github.com/users/mgechev/events{/privacy}","received_events_url":"https://api.github.com/users/mgechev/received_events","type":"User","site_admin":false},"assignees":[{"login":"mgechev","id":455023,"avatar_url":"https://avatars.githubusercontent.com/u/455023?v=3","gravatar_id":"","url":"https://api.github.com/users/mgechev","html_url":"https://github.com/mgechev","followers_url":"https://api.github.com/users/mgechev/followers","following_url":"https://api.github.com/users/mgechev/following{/other_user}","gists_url":"https://api.github.com/users/mgechev/gists{/gist_id}","starred_url":"https://api.github.com/users/mgechev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgechev/subscriptions","organizations_url":"https://api.github.com/users/mgechev/orgs","repos_url":"https://api.github.com/users/mgechev/repos","events_url":"https://api.github.com/users/mgechev/events{/privacy}","received_events_url":"https://api.github.com/users/mgechev/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-01-13T05:35:32Z","updated_at":"2017-01-13T13:25:36Z","closed_at":null,"body":"<!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING\r\n-->\r\n\r\n**I'm submitting a ...**  (check one with \"x\")\r\n```\r\n[X] bug report\r\n[ ] feature request\r\n[ ] support request\r\n```\r\n\r\nI'm not sure if this is an issue with the seed, an issue with the Angular AOT compiler, or an issue with TypeScript itself.\r\n\r\nIf I add a custom TSD (d.ts) to `tools/manual_typings/project`, I can do normal dev and prod builds OK. The build correctly handles the use of ambient definitions.\r\n\r\nHowever, the AOT build will fail during `compile.ahead.prod` (\"Cannot find name 'XXX'.\").\r\n\r\nThe only way I could get it to work was to use more of an @types approach: \r\n\r\n- I created a folder containing my definition (in an index.d.ts) file under `tools/manual_typings/project`\r\n- I modified the `src/client/tsconfig.json` to add a `typeRoot` and `type`:\r\n```\r\n\"typeRoots\": [\r\n  \"../../node_modules/@types\",\r\n  \"../../node_modules\",\r\n  \"../../tools/manual_typings/project\"\r\n],\r\n\"types\": [\r\n  \"node\",\r\n  \"jasmine\",\r\n  \"protractor\",\r\n  \"systemjs\",\r\n  \"XXX\"\r\n]\r\n```\r\n\r\nI can create a branch that shows the issue if that would help, but I suspect you can reproduce it pretty easily. But as I said, I'm not sure if this means the way the seed project handles ambient definitions needs to change, or if this is expected behavior with the current AoT compiler."},"comment":{"url":"https://api.github.com/repos/mgechev/angular-seed/issues/comments/272442162","html_url":"https://github.com/mgechev/angular-seed/issues/1763#issuecomment-272442162","issue_url":"https://api.github.com/repos/mgechev/angular-seed/issues/1763","id":272442162,"user":{"login":"mgechev","id":455023,"avatar_url":"https://avatars.githubusercontent.com/u/455023?v=3","gravatar_id":"","url":"https://api.github.com/users/mgechev","html_url":"https://github.com/mgechev","followers_url":"https://api.github.com/users/mgechev/followers","following_url":"https://api.github.com/users/mgechev/following{/other_user}","gists_url":"https://api.github.com/users/mgechev/gists{/gist_id}","starred_url":"https://api.github.com/users/mgechev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgechev/subscriptions","organizations_url":"https://api.github.com/users/mgechev/orgs","repos_url":"https://api.github.com/users/mgechev/repos","events_url":"https://api.github.com/users/mgechev/events{/privacy}","received_events_url":"https://api.github.com/users/mgechev/received_events","type":"User","site_admin":false},"created_at":"2017-01-13T13:25:36Z","updated_at":"2017-01-13T13:25:36Z","body":"@brian428 after the build passes I'll merge and the issue should be fixed. Again, thanks for letting me know!"}}
{"actor":{"display_login":"mgechev"}}