Skip to content

XXX has or is using name 'Foo' from external module "../bar" but cannot be named #9944

Description

@vilicvane

TypeScript Version: 2.0.0

npm init
npm install clime --save

tsconfig.json

{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noEmitOnError": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"strictNullChecks": true,
"declaration": true,
"sourceMap": true,
"rootDir": "src",
"outDir": "bld"
},
"exclude": [
"node_modules"
]
}

src/cli.ts

#!/usr/bin/env node
import*asPathfrom'path';import{CLI,Shim}from'clime';letcli=newCLI('henge',Path.join(__dirname,'commands'));// This is okay.exportdefaultcli;// This gives errors:// TS4023: Exported variable 'foo' has or is using name 'Promise' from external module "C:/Projects/clime/node_modules/thenfail/bld/promise" but cannot be named.// TS4023: Exported variable 'foo' has or is using name 'Printable' from external module "C:/Projects/clime/bld/core/object" but cannot be named.letfoo=cli.execute([]);export{foo};

It seems that if I import Printable from clime, the second error would go away, but I cannot import Promise from the dependency of clime.

Is this expected behavior or a bug?

Metadata

Metadata

Labels

Domain: Declaration EmitThe issue relates to the emission of d.ts filesFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions