Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exported variable 'X' has or is using name 'Y' from external module "Z" but cannot be named. #20657

Closed
robyoder opened this issue Dec 12, 2017 · 3 comments
Assignees
Labels
Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files Fixed A PR has been merged for this issue

Comments

@robyoder
Copy link

TypeScript Version: 2.7.0-dev.20171212

Code

// thingA.ts
export interface ThingA { }

// thingB.ts
export interface ThingB { }

// things.ts
export { ThingA } from "./thingA";
export * from "./thingB";

// index.ts
import * as things from "./things";
export const thing1 = (param: things.ThingA) => null;
export const thing2 = (param: things.ThingB) => null;

// tsconfig.json
{
  "compilerOptions": {
    "declaration": true
  }
}

Expected behavior:

Project compiles without errors.

Actual behavior:

index.ts(3,14): error TS4023: Exported variable 'thing2' has or is using name 'ThingB' from external module "/Users/rob/Projects/tsctest/thingB" but cannot be named.

Additional information:

@weswigham fixed the following very similar issues in #19852:

In fact, before his fix, line 2 of index.ts would also fail.

I've pushed this repro as a project here: https://github.com/robyoder/tsctest

@johnpapa
Copy link

@mhegazy thanks for fixing this .. can you clarify what we need t do to get this fix?

@mhegazy
Copy link
Contributor

mhegazy commented Jan 18, 2018

typescript@rc or typescript@next should have the fix. the fix should also be included in typescript@2.7.1 coming out before the end of the month.

@robyoder
Copy link
Author

Super weird: This issue is not fixed when using a type named Account, but it's fixed for everything else. Opened #21313.

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: Declaration Emit The issue relates to the emission of d.ts files Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

4 participants