{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10968","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10968/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10968/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10968/events","html_url":"https://github.com/Microsoft/TypeScript/issues/10968","id":177616604,"number":10968,"title":"Duplicate identifier error when dependent project supplies its own type definitions for a shared library","user":{"login":"mattyork","id":666259,"avatar_url":"https://avatars.githubusercontent.com/u/666259?v=3","gravatar_id":"","url":"https://api.github.com/users/mattyork","html_url":"https://github.com/mattyork","followers_url":"https://api.github.com/users/mattyork/followers","following_url":"https://api.github.com/users/mattyork/following{/other_user}","gists_url":"https://api.github.com/users/mattyork/gists{/gist_id}","starred_url":"https://api.github.com/users/mattyork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattyork/subscriptions","organizations_url":"https://api.github.com/users/mattyork/orgs","repos_url":"https://api.github.com/users/mattyork/repos","events_url":"https://api.github.com/users/mattyork/events{/privacy}","received_events_url":"https://api.github.com/users/mattyork/received_events","type":"User","site_admin":false},"labels":[{"id":113970366,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":114001888,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Fixed","name":"Fixed","color":"bfe5bf","default":false}],"state":"closed","locked":false,"assignee":{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false},"assignees":[{"login":"RyanCavanaugh","id":6685088,"avatar_url":"https://avatars.githubusercontent.com/u/6685088?v=3","gravatar_id":"","url":"https://api.github.com/users/RyanCavanaugh","html_url":"https://github.com/RyanCavanaugh","followers_url":"https://api.github.com/users/RyanCavanaugh/followers","following_url":"https://api.github.com/users/RyanCavanaugh/following{/other_user}","gists_url":"https://api.github.com/users/RyanCavanaugh/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanCavanaugh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanCavanaugh/subscriptions","organizations_url":"https://api.github.com/users/RyanCavanaugh/orgs","repos_url":"https://api.github.com/users/RyanCavanaugh/repos","events_url":"https://api.github.com/users/RyanCavanaugh/events{/privacy}","received_events_url":"https://api.github.com/users/RyanCavanaugh/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/28","html_url":"https://github.com/Microsoft/TypeScript/milestones/TypeScript%202.0.5","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/milestones/28/labels","id":1973939,"number":28,"title":"TypeScript 2.0.5","description":"","creator":{"login":"mhegazy","id":8000722,"avatar_url":"https://avatars.githubusercontent.com/u/8000722?v=3","gravatar_id":"","url":"https://api.github.com/users/mhegazy","html_url":"https://github.com/mhegazy","followers_url":"https://api.github.com/users/mhegazy/followers","following_url":"https://api.github.com/users/mhegazy/following{/other_user}","gists_url":"https://api.github.com/users/mhegazy/gists{/gist_id}","starred_url":"https://api.github.com/users/mhegazy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhegazy/subscriptions","organizations_url":"https://api.github.com/users/mhegazy/orgs","repos_url":"https://api.github.com/users/mhegazy/repos","events_url":"https://api.github.com/users/mhegazy/events{/privacy}","received_events_url":"https://api.github.com/users/mhegazy/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":20,"state":"closed","created_at":"2016-08-31T00:19:52Z","updated_at":"2016-10-05T21:24:50Z","due_on":null,"closed_at":"2016-10-05T21:24:50Z"},"comments":11,"created_at":"2016-09-17T23:06:55Z","updated_at":"2016-11-16T02:42:28Z","closed_at":"2016-09-22T17:00:37Z","body":"**TypeScript Version:**  2.0.2\n- I have two directories containing typescript projects: proj1, proj2. \n- Both projects depend on React, and definitions are installed for each through `npm install @types/react`\n- They compile independently. \n\n![image](https://cloud.githubusercontent.com/assets/666259/18611485/51593a8a-7cef-11e6-9705-10e30490cd8c.png)\n\nThe problem: I get a \"duplicate identifier\" error when compiling proj2:\n- when the compiler processes a proj2 file it resolves module `'react'` to proj2's `proj2/node_modules/@types/react`. All good.\n- when the compiler processes a proj1 file it resolves `'react'` to `proj1/node_modules/@types/react` which would be fine, and hits the duplicate identifier error\n\n**Simplified Repro:** \n1. Unzip [bugreport.zip](https://github.com/Microsoft/TypeScript/files/478443/bugreport.zip)\n2. `cd bugreport/proj1`\n3. `./node_modules/.bin/tsc`\n4. `cd ../proj2`\n5. `./node_modules/.bin/tsc`\n\n**Expected behavior:** succeeds. All is good. \n\n**Actual behavior:** \n\n```\n../proj1/node_modules/@types/react/index.d.ts(7,21): error TS2300: Duplicate identifier 'React'.\nindex.ts(4,17): error TS2345: Argument of type 'typeof Proj1Comp' is not assignable to parameter of type 'ReactElement<{}>'.\n  Property 'type' is missing in type 'typeof Proj1Comp'.\nnode_modules/@types/react/index.d.ts(7,21): error TS2300: Duplicate identifier 'React'.\n```\n\nHow are we supposed to handle these situations where a dependency brings its own type definitions for a shared library?\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/260837693","html_url":"https://github.com/Microsoft/TypeScript/issues/10968#issuecomment-260837693","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/10968","id":260837693,"user":{"login":"mKlus","id":1771891,"avatar_url":"https://avatars.githubusercontent.com/u/1771891?v=3","gravatar_id":"","url":"https://api.github.com/users/mKlus","html_url":"https://github.com/mKlus","followers_url":"https://api.github.com/users/mKlus/followers","following_url":"https://api.github.com/users/mKlus/following{/other_user}","gists_url":"https://api.github.com/users/mKlus/gists{/gist_id}","starred_url":"https://api.github.com/users/mKlus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mKlus/subscriptions","organizations_url":"https://api.github.com/users/mKlus/orgs","repos_url":"https://api.github.com/users/mKlus/repos","events_url":"https://api.github.com/users/mKlus/events{/privacy}","received_events_url":"https://api.github.com/users/mKlus/received_events","type":"User","site_admin":false},"created_at":"2016-11-16T02:42:28Z","updated_at":"2016-11-16T02:42:28Z","body":"@mhegazy I have created new issue #12286."}}
{"actor":{"display_login":"mKlus"}}