Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular Visual Studio代码可以';t解析角度';s tsconfig.base路径_Angular_Typescript - Fatal编程技术网

Angular Visual Studio代码可以';t解析角度';s tsconfig.base路径

Angular Visual Studio代码可以';t解析角度';s tsconfig.base路径,angular,typescript,Angular,Typescript,我在Angular 9的tsconfig.base.json中添加了一个自定义路径,所有组件和所有东西都可以完美加载。但visual Studio代码正在抱怨并抛出错误,无法在我的应用程序路由模块和应用程序模块中找到模块。如何解决这个问题 tsconfig.base.json- { "compileOnSave": false, "compilerOptions": { "baseUrl": "./", "paths": { "@/*": ["src/app/*"

我在Angular 9的tsconfig.base.json中添加了一个自定义路径,所有组件和所有东西都可以完美加载。但visual Studio代码正在抱怨并抛出错误,无法在我的应用程序路由模块和应用程序模块中找到模块。如何解决这个问题

tsconfig.base.json-

{
"compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "paths": {
      "@/*": ["src/app/*"],
      "@env/*": ["src/environments/*"]
    },
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    ....
}
应用程序模块-

import { AppRoutingModule, routingComponents } from '@/app-routing.module';
import { AppComponent } from '@/app.component';

也许你编辑错了文件,。。
我也使用angular 9.0,我在tsconfig.json中进行了相同的配置,而不是tsconfig.base.json

您能提供stackblitz吗?您在vscode或终端中遇到错误了吗?尝试重新启动服务器。