Typescript 找不到类型脚本导出
自从我更新angular cli和nestjs版本以来,我收到了数百条警告,说明找不到我的自定义类型定义和接口。但是我的NestJSAPI仍然可以正常工作 我正在像这样导出我的接口Typescript 找不到类型脚本导出,typescript,nestjs,Typescript,Nestjs,自从我更新angular cli和nestjs版本以来,我收到了数百条警告,说明找不到我的自定义类型定义和接口。但是我的NestJSAPI仍然可以正常工作 我正在像这样导出我的接口 export interface Role {...} import { Role } from '@project/api-datatypes'; 得到这个警告 WARNING in ./apps/api/src/app/users/dto/update-user.dto.ts 31:75-80 "e
export interface Role {...}
import { Role } from '@project/api-datatypes';
得到这个警告
WARNING in ./apps/api/src/app/users/dto/update-user.dto.ts 31:75-80
"export 'Role' was not found in '@project/api-datatypes'
我的进口看起来像这样
export interface Role {...}
import { Role } from '@project/api-datatypes';
最新版本中更改了什么?我必须做什么来修复这些警告
目前我正在运行以下版本:
├── @angular/cli@11.0.6
├── @nestjs/cli@7.5.1
├── npm@6.14.4
├── nx@10.3.0
└── typescript@4.0.3
刚刚找到解决方案,因为typescript 3.8引入了仅类型导出/导入,所以我需要从'@project/api datatypes'编写导入类型{Role};因此,缺少了一个简单的“类型”
请参阅链接:FWIW,导出和导入都写得正确,因此这将是一个工具配置或路径问题。谢谢@T.J.Crowder,但我唯一更改的是我库中的nestjscli和angularcli versionmy index.ts看起来像是从“/role.interface”导出的*;您可能在项目上有错误的路径,请尝试在没有项目的情况下添加完整路径