Skip to content

ESM Import Failing - v6.0.0 #189

@dscalzi

Description

@dscalzi

minimatch - 6.0.0
typescript - 4.9.4
node - 16.17.0

Error:

src/structure/spec_model/module/Module.struct.ts:218:59 - error TS2349: This expression is not callable.
  Type 'typeof import("F:/Project/node_modules/minimatch/dist/cjs/index")' has no call signatures.

218         return this.untrackedFilePatterns.find(pattern => minimatch(pathRelativeToContainer, pattern))

Usage:

import minimatch from 'minimatch'

protected isFileUntracked(pathRelativeToContainer: string): string | undefined {
    return this.untrackedFilePatterns.find(pattern => minimatch(pathRelativeToContainer, pattern))
}

tsconfig

{
  "compilerOptions": {
    "target": "ES2021",
    "module": "Node16",
    "lib": ["ES2021"],
    "sourceMap": true,
    "outDir": "dist",
    "moduleResolution": "Node16",
    "esModuleInterop": true
  }
}

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