Skip to content

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

@robyoder

Description

@robyoder

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

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions