Skip to content

Duplicate identifier error when 2 projects, main and dependent, both supply type definitions for a knockout/jquery library #12286

@mKlus

Description

@mKlus

I have VS solution that has multiple projects.
There is a ProjectA that imports jquery and knockout and ProjectB that imports class from ProjectA and also imports knockout and jquery.
When I compile the solution (or projectB) in VS 2015 Update 3 with TS 2.0.6 installed I get the below errors.

2>D:\Temp\TSProject\TSProjectA\node_modules\@types\jquery\index.d.ts(623,5): error TS2374: Build:Duplicate string index signature. 2>D:\Temp\TSProject\TSProjectA\node_modules\@types\jquery\index.d.ts(2872,5): error TS2374: Build:Duplicate string index signature. 2>D:\Temp\TSProject\TSProjectA\node_modules\@types\jquery\index.d.ts(2873,5): error TS2375: Build:Duplicate number index signature. 2>D:\Temp\TSProject\TSProjectA\node_modules\@types\jquery\index.d.ts(3246,5): error TS2300: Build:Duplicate identifier 'export='. 2>D:\Temp\TSProject\TSProjectA\node_modules\@types\knockout\index.d.ts(8,5): error TS2374: Build:Duplicate string index signature. 2>D:\Temp\TSProject\TSProjectA\node_modules\@types\knockout\index.d.ts(14,5): error TS2374: Build:Duplicate string index signature. 2>D:\Temp\TSProject\TSProjectA\node_modules\@types\knockout\index.d.ts(18,5): error TS2374: Build:Duplicate string index signature. 2>D:\Temp\TSProject\TSProjectA\node_modules\@types\knockout\index.d.ts(38,5): error TS2374: Build:Duplicate string index signature. 2>D:\Temp\TSProject\TSProjectA\node_modules\@types\knockout\index.d.ts(160,5): error TS2374: Build:Duplicate string index signature. 2>D:\Temp\TSProject\TSProjectA\node_modules\@types\knockout\index.d.ts(682,2): error TS2300: Build:Duplicate identifier 'export='. 2>D:\Temp\TSProject\TSProjectMain\node_modules\@types\jquery\index.d.ts(3246,5): error TS2300: Build:Duplicate identifier 'export='. 2>D:\Temp\TSProject\TSProjectMain\node_modules\@types\knockout\index.d.ts(682,2): error TS2300: Build:Duplicate identifier 'export='.

I have attached a simplified solution where the issue is reproducible.

TSProject.zip

Seems to be related to issue #10968.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions