Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is vscode giving me the error "No Inputs where found in file tsconfig.json" when tsc found none?

This is the config file for my typescript project:

{
    "compilerOptions": {
        "sourceMap": true,
        "target": "es5",
        "outFile": "js/app.js"
    },
    "files": [
        "src/main.ts",
        "src/bootstrap.ts",
        "libs/phaser.d.ts"
    ],
    "exclude": [
        "docs",
        "css",
        "index.html"
    ]
}

VS Code is giving me this error:

file: 'file:///e%3A/Programming/TypeScript/tsconfig.json' severity: 'Error' message: 'No inputs were found in config file 'e:/Programming/TypeScript/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["node_modules","bower_components","jspm_packages"]'.' at: '1,1' source: 'js'

I googled the Definition for the tsconfig file, but I couldn't find the source for this error. What am I doing wrong here? When compiling it with tsc, everything is fine.

like image 438
BadSnowflake Avatar asked Nov 08 '22 23:11

BadSnowflake


2 Answers

I encountered a similar error (thrown by VS Code) and the solution for me was to add a .ts extension to the file which serves as the entry point for my application. Typescript just needed something to compile ("an input").

Perhaps specifying the include path by adding

"include": [
   '**/*'
]

to your tsconfig.json will take care of it?

like image 98
vince Avatar answered Nov 15 '22 12:11

vince


Adding this to tsconfig.json fixed it for me:

"compilerOptions": {
  ...
  "rootDir": "./src",
  ...
}
like image 22
Dean Avatar answered Nov 15 '22 11:11

Dean