Shaun Xu
Shaun Xu

Reputation: 4666

Got "TS2300: Duplicate identifier 'Account'" error after upgraded to Typescript 2.9.1

After I upgraded to Typescript 2.9.1 (from 2.8) I got compile error said

node_modules/typescript/lib/lib.es2017.full.d.ts:33:11 - error TS2300: Duplicate identifier 'Account'.

This is never happened when I was using typescript 2.7 and 2.8.

Environment:

// tsconfig.json
{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es2017",
    "noImplicitAny": true,
    "moduleResolution": "node",
    "sourceMap": true,
    "outDir": "ts-build",
    "baseUrl": ".",
    "paths": {
      "kernel/*": [
        "./server/kernel/*"
      ]
    },
    "rootDir": ".",
    "allowJs": true,
    "typeRoots": [
      "node_modules/@types"
    ],
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "types": [],
    "keyofStringsOnly": true
  },
  "include": [
    "server/**/*",
    "app.*.js"
  ],
  "exclude": [
    "node_modules"
  ]
}

Upvotes: 4

Views: 1145

Answers (1)

Shaun Xu
Shaun Xu

Reputation: 4666

Just a workaround, I'm using skipLibCheck: true to bypass the type check in lib files so there's no error. But I still don't know why this happen in 2.9.1.

Upvotes: 1

Related Questions