Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve "Corresponding file not included in tsconfig.json" error in WebStorm?

I am using highland.js and have installed it with its type definition:

jq .dependencies package.json | grep highland
  "@types/highland": "https://registry.npmjs.org/@types/highland/-/highland-1.14.30.tgz",
  "highland": "^2.9.0",

I am using PhpStorm (which uses the WebStorm component for TypeScript).

When I typehint for:

Highland.Stream<any>

PhpStorm complains about the Stream:

Corresponding file not included in tsconfig.json

Screenshot of the error

Yet the go to declaration works and it jumps to node_modules/@types/highland/index.d.ts:367:

interface Stream<R> extends NodeJS.EventEmitter { ... }

I can compile the code fine with tsc without errors and it's working as expected. What is PhpStorm's / WebStorm's problem?

$ jq . tsconfig.json
{
  "compilerOptions": {
    "module": "commonjs",
    "lib": [
      "es2016",
      "dom"
    ],
    "target": "es6",
    "noImplicitAny": true,
    "sourceMap": true,
    "outDir": "dist",
    "strictNullChecks": true,
    "skipLibCheck": true,
    "types": [
      "node",
      "mocha",
      "chai",
      "sinon"
    ]
  },
  "exclude": [
    "node_modules",
    "src/typings-custom/main.d.ts"
  ]
}

I tried adding highland to types to no avail, and I have no idea what the error is telling me.

like image 755
k0pernikus Avatar asked Dec 14 '16 14:12

k0pernikus


People also ask

How do I fix no inputs were found in config file Tsconfig json?

The error "No inputs were found in config file" occurs when we try to build a project that does not contain any TypeScript files. To solve the error, add an empty file with a . ts extension in your project's root directory and restart your IDE if necessary. Copied!

What is include and exclude in Tsconfig json?

The include and exclude properties take a list of glob-like file patterns. The supported glob wildcards are: * matches zero or more characters (excluding directory separators)

What is include in Tsconfig json?

The tsconfig.json file specifies the root files and the compiler options required to compile the project. JavaScript projects can use a jsconfig.json file instead, which acts almost the same but has some JavaScript-related compiler flags enabled by default.


1 Answers

I had the same issue with Webstorm 2018. I closed and reopened Webstorm and, voilà: the red lines were gone! I just needed to refresh Webstorm I guess. Since Webstorm and PHPStorm are both under the same umbrellas, maybe this will work for you as well.

like image 178
MattR Avatar answered Sep 21 '22 12:09

MattR