Skip to content

Duplicate identifier errors when using @types inside a Windows junction #11333

@smrq

Description

@smrq

TypeScript Version: 2.0.3

Code

  • Install any type declaration from @types on npm. (For this example I am using @types/react, but this is also reproducible with other declaration files: @types/angular, @types/jquery, @types/lodash, etc.)
  • Create a junction to the source folder.
  • Then, navigate into the junction (instead of the real folder).
  • Attempt to compile the following file:
import * as React from 'react';

A minimal reproducing repo with complete steps to reproduce is available here: https://github.com/smrq/tsc-junction-repro

Expected behavior:

Compiles without errors.

Actual behavior:

Compiles with the following errors:

C:/Code/tsc-junction-repro/node_modules/@types/react/index.d.ts(7,21): error TS2300: Duplicate identifier 'React'.
node_modules/@types/react/index.d.ts(7,21): error TS2300: Duplicate identifier 'React'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions