Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate identifier 'export='

Tags:

typescript

I know this question was asked here before, but none of the solutions is working for me. I have the following tsconfig:

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es6",
    "declaration": true,
    "outDir": "./dist"
  },
  "typeRoots": ["./node_modules/@types/*"],
  "include": [
    "./src/**/*"
  ]
}

but when I run tsc I get:

../node_modules/@types/passport/index.d.ts(100,5): error TS2300: Duplicate identifier 'export='.
node_modules/@types/passport/index.d.ts(100,5): error TS2300: Duplicate identifier 'export='.

How is it possible that I still get ../node_modules/@types/ (etc) when I specifically said only include the ./src folder and only types from ./node_modules/@types?

I'm using typescript Version 2.4.0 (but have the same problem with version 2.3.4)

like image 556
bersling Avatar asked Dec 01 '25 06:12

bersling


1 Answers

What happens if you try the following tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6",
        "declaration": true,
        "rootDir": "src",
        "outDir": "dist",
        "skipLibCheck": true,
        "skipDefaultLibCheck": true
    }
}
like image 99
Nitzan Tomer Avatar answered Dec 06 '25 06:12

Nitzan Tomer