Skip to content

Error when setting compilerOptions.module and compilerOptions.target to "esNext", "es2020" or similar #31

Description

@sjordan1975

Error when setting compilerOptions.module and compilerOptions.target to "esNext", "es2020" or similar.

Ex. According to https://www.typescriptlang.org/docs/handbook/compiler-options.html, "esNext" would be a valid value for both module and target

Example tsconfig.json:

{
    "compilerOptions": {
        "module": "esNext",
        "target": "esNext",
    },
    "files": [
        "./lib/myCode.ts",
        "./node_modules/marklogic-typescript-definitions/ts/index.d.ts"
    ]
}

Error similar to the following

$ tsc
../../../.nvm/versions/node/v14.4.0/lib/node_modules/typescript/lib/lib.es2015.iterable.d.ts:41:6 - error TS2300: Duplicate identifier 'IteratorResult'.

41 type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;
        ~~~~~~~~~~~~~~

  node_modules/marklogic-typescript-definitions/ts/types.d.ts:192:11
    192 interface IteratorResult<T> {
                  ~~~~~~~~~~~~~~
    'IteratorResult' was also declared here.

node_modules/marklogic-typescript-definitions/ts/types.d.ts:192:11 - error TS2300: Duplicate identifier 'IteratorResult'.

192 interface IteratorResult<T> {
              ~~~~~~~~~~~~~~

  ../../../.nvm/versions/node/v14.4.0/lib/node_modules/typescript/lib/lib.es2015.iterable.d.ts:41:6
    41 type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;
            ~~~~~~~~~~~~~~
    'IteratorResult' was also declared here.


Found 2 errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions