Skip to content

Error TS2349 using concurrently in full ESM module #454

@throrin19

Description

@throrin19

Hello,

I have a problem using concurrently (and others modules) in my project after migrate from CJS to full ESM. I have the error TS2349 when I try to call concurrently function. But, In VSCode, the definition is correctly loaded on CTRL+click :/

This is my config :

  • tsconfig.json
    {
      "compileOnSave": false,
      "compilerOptions": {
        "rootDir": ".",
        "sourceMap": true,
        "declaration": true,
        "esModuleInterop": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "importHelpers": false,
        "resolveJsonModule": true,
        "noImplicitAny": false,
        "strict": true,
        "useDefineForClassFields": false,
        "target": "ES2022",
        "lib": [
          "esnext"
        ],
        "skipLibCheck": true,
        "skipDefaultLibCheck": true,
        "baseUrl": ".",
        "outDir": "dist",
        "types": [
          "node"
        ],
        "module": "NodeNext",
        "moduleResolution": "NodeNext",
      }
    }

And my example code :

import concurrently from 'concurrently';

const main = async () => {
    concurrently([
        { command : 'ls /etc' },
        { command : 'ls /usr' }
    ]);
}

main();

He is a screen on my VSCode :
image

I don't know how to do to fix that. I think my problem is with typescript, but I don't understand how to fix that :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions