Joshua
Joshua

Reputation: 1393

tsconfig.json shows error: Entry point for implicit type library 'glob'

I have a Monorepo which uses Typescript. I have a common folder which shows this error on the top of the file -> Entry point for implicit type library 'glob'. I am not sure what is wrong with the configuration.

Screenshot:

enter image description here

tsconfig.json

{
"extends": "../../tsconfig.json",
"compilerOptions": {
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "isolatedModules": true,
    "jsx": "react-native",
    "lib": [
        "es2021"
    ],
    "moduleResolution": "node",
    "noEmit": false,
    "strict": true,
    "target": "esnext",
    "composite": true,
    "rootDir": ".",
    "outDir": "dist",
    "declaration": true,
    "emitDeclarationOnly": true,
    "declarationMap": true
},
"exclude": [
    "node_modules",
]
}

Any Suggestions?

Upvotes: 18

Views: 29804

Answers (3)

Simon_Weaver
Simon_Weaver

Reputation: 145880

Remember that types are for npm projects that weren't written in Typescript.

So if the library is migrated to Typescript you can uninstall the types.

I just had the same issue with marked in an Angular project. Marked is now written in Typescript so doesn't need @types.

npm uninstall @types/marked

A big clue this may have happened is if the version under @types differs greatly from the project itself.

Upvotes: 2

user21568697
user21568697

Reputation:

Include "types" in your "compilerOptions" ...

{
  "compilerOptions": {
    "types": [
      // ... your other types
      "node"
    ],
  },
}

Upvotes: 21

Joshua
Joshua

Reputation: 1393

I just re-started VS Code and the error was gone.

Upvotes: 39

Related Questions