{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8468","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8468/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8468/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8468/events","html_url":"https://github.com/Microsoft/TypeScript/issues/8468","id":153122535,"number":8468,"title":"[bus] tsc error: cannot write file 'main.d.ts' because it would overwrite input file","user":{"login":"AliMD","id":697913,"avatar_url":"https://avatars.githubusercontent.com/u/697913?v=3","gravatar_id":"","url":"https://api.github.com/users/AliMD","html_url":"https://github.com/AliMD","followers_url":"https://api.github.com/users/AliMD/followers","following_url":"https://api.github.com/users/AliMD/following{/other_user}","gists_url":"https://api.github.com/users/AliMD/gists{/gist_id}","starred_url":"https://api.github.com/users/AliMD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliMD/subscriptions","organizations_url":"https://api.github.com/users/AliMD/orgs","repos_url":"https://api.github.com/users/AliMD/repos","events_url":"https://api.github.com/users/AliMD/events{/privacy}","received_events_url":"https://api.github.com/users/AliMD/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Question","name":"Question","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-05-04T21:46:13Z","updated_at":"2016-05-04T22:43:54Z","closed_at":null,"body":"Excuse me for writing my question here but i guess its a bug.\r\n\r\nI have issue when run `tsc`\r\n```\r\nerror TS5055: Cannot write file 'index.d.ts' because it would overwrite input file.\r\n```\r\nmy `tsconfig.json`:  \r\n```json\r\n    {\r\n      \"compilerOptions\": {\r\n        \"target\": \"es6\",\r\n        \"module\": \"commonjs\",\r\n        \"moduleResolution\": \"node\",\r\n        \"declaration\": true,\r\n        \"newLine\": \"LF\",\r\n        \"preserveConstEnums\": true,\r\n        \"pretty\": true,\r\n        \"experimentalDecorators\": true\r\n      },\r\n    \r\n      \"exclude\": [\r\n        \"node_modules\",\r\n        \"typings\"\r\n      ]\r\n    }\r\n```\r\n\r\n**TypeScript Version: 1.8.10** \r\n\r\nThis issue solved when:\r\n\r\n 1. Exclude `index.ts` in `tsconfig`\r\n 2. Run `tsc index.ts`\r\n 3. Turn `declaration` off in `tsconfig`\r\n 4. Rename `indextx` to foo.ts!\r\n\r\nI have same issue when i rename index.ts to foo.ts and change `package.json` to\r\n```json\r\n    \"typescript\": {\r\n      \"main\": \"foo.ts\"\r\n    }\r\n```\r\ntsc error:\r\n\r\n    error TS5055: Cannot write file 'index.d.ts' because it would overwrite input file.\r\n\r\ncontent of index file no mater, any code content has same issue!\r\n\r\nWhat can i do for fix it ?  \r\nThank you in advance and excuse me again for asking my question here.\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/217025950","html_url":"https://github.com/Microsoft/TypeScript/issues/8468#issuecomment-217025950","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/8468","id":217025950,"user":{"login":"AliMD","id":697913,"avatar_url":"https://avatars.githubusercontent.com/u/697913?v=3","gravatar_id":"","url":"https://api.github.com/users/AliMD","html_url":"https://github.com/AliMD","followers_url":"https://api.github.com/users/AliMD/followers","following_url":"https://api.github.com/users/AliMD/following{/other_user}","gists_url":"https://api.github.com/users/AliMD/gists{/gist_id}","starred_url":"https://api.github.com/users/AliMD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AliMD/subscriptions","organizations_url":"https://api.github.com/users/AliMD/orgs","repos_url":"https://api.github.com/users/AliMD/repos","events_url":"https://api.github.com/users/AliMD/events{/privacy}","received_events_url":"https://api.github.com/users/AliMD/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T22:43:54Z","updated_at":"2016-05-04T22:43:54Z","body":"@zhanbos and @mhegazy Thank you for your attention to this matter\r\n\r\n\r\nراستی محمد آقا شما ایرانی هستی عزیز ؟"}}