我的几个学生在一个Astro项目中遇到了这个问题。
Astro默认包括一个tsconfig.json
文件,这个文件在VS Code中给他们带来了一个错误。
这个错误来自于tsconfig.json
,它说
No inputs were found in config file
我们没有写任何TypeScript,所以这是个奇怪的问题。
这里有一些可能的解决方案。
首先,尝试重新启动VS Code。
如果这不起作用,在有tsconfig.json
文件的同一文件夹中添加一个空的file.ts
文件。
或者删除tsconfig.json
。
除非你打算使用TypeScript,在这种情况下,你可以通过添加include
,来配置它指向你项目中的TypeScript文件。
{
"compilerOptions": {
"moduleResolution": "node"
}
}
到
{
"compilerOptions": {
"moduleResolution": "node"
},
"include": [
"./src/**/*.ts"
]
}