Skip to content

duplicate identifier when using @types #10664

@donaldpipowitch

Description

@donaldpipowitch

TypeScript Version: 2.0.2

Code

// index.ts
// empty
// package.json
{
  "name": "test",
  "version": "1.0.0",
  "scripts": {
    "build": "tsc index.ts --outFile build.js"
  },
  "dependencies": {
    "@types/fs-extra-promise": "0.0.28",
    "@types/karma": "^0.13.32",
    "typescript": "^2.0.2"
  }
}
// tsconfig.json
{
  "compilerOptions": {
    "target": "es6",
    "moduleResolution": "node"
  },
  "exclude": [
    "node_modules"
  ]
}
  • $ npm -v // 3.10.6
  • $ npm i
  • $ npm run build

Expected behavior:

Based on this tweet I think no error should happen.

If I understand this tweet wrong, I still think no error should happen, because it should be fine for Karma and fs-extra-promise to use different versions of bluebird. If this works with Node, it should work with TypeScript, too.

Actual behavior:

Errors:

node_modules/@types/bluebird/index.d.ts(772,5): error TS2300: Duplicate identifier 'export='.
node_modules/@types/karma/node_modules/@types/bluebird/index.d.ts(772,1): error TS2300: Duplicate identifier 'export='.

Metadata

Metadata

Assignees

No one assigned

    Labels

    @typesRelates to working with .d.ts files (declaration/definition files) from DefinitelyTypedBugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions