属性' getType'类型不存在
我正在从Angular 12升级到Angular 13-构建时,我在终端中遇到了一些错误,
Error: src/app/components/feeds/replies/reply.ts:81:31 - error TS2339: Property 'getType' does not exist on type 'typeof import("/Users/me/Sites/app-ng/node_modules/@types/mime/index")'.
81 const mimeType = mime.getType(item) || '';
我已经检查了代码,并且在Mime类中确实存在getType
(我可以控制单击文件中的单击并打开它相关文件罚款) - 任何人都知道为什么会发生此错误以及我如何修复它?
I am upgrading from Angular 12 to Angular 13 - when building I get some errors in the terminal
Error: src/app/components/feeds/replies/reply.ts:81:31 - error TS2339: Property 'getType' does not exist on type 'typeof import("/Users/me/Sites/app-ng/node_modules/@types/mime/index")'.
81 const mimeType = mime.getType(item) || '';
I have checked the code and the getType
does exist on mime class (I can control click in the file and it opens the relevant file fine) - anyone know why this error occurs and how I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MIME(2.x和3.x)的先前版本依赖于外部类型的定义(@type/mime),并且存在/存在定义问题。
来自 4.0.0 内置了ts支持,现在消失了。
所以公正
并继续。
Previous versions of Mime (2.x and 3.x) rely on external type definitions (@types/mime) and there were/are issues with the definitions.
From 4.0.0 onward TS support is built-in and this issue is now gone.
So just
and carry on.