当前位置:网站首页>TS solves the problem that the type file of the imported plug-in does not exist
TS solves the problem that the type file of the imported plug-in does not exist
2022-07-19 11:25:00 【User 6256742】
When we use TypeScript In development , We often use some popular plug-ins that have not been maintained for a long time , These plug-ins are basically JavaScript Development is carried out in TypeScript Errors will be reported in the project .
Installation type :
Many plug-ins will prompt you to install @types/XXX, This is the official release of the plug-in in @types In the project TS Type file , If you are prompted that you can try to install, you can basically solve the problem , If the error prompt is like that in my picture , Then see Adding types .
Add type :
stay tsconfig.json Tested xx.d.ts Write the plug-in in TS type , I'm lazy and don't think it's necessary to type it , So export it directly any 了 .
quite a lot TS After the framework is created, a d.ts The file of ( for example Vite There will be one. vite-env.d.ts) Add it to it , Or create a new one in the allowed directory . This is equivalent to ts Declared a module , The type is any.
declare module "XXX" {
export const a: any;
}边栏推荐
- Use and principle of ThreadLocal variable
- 8.固定收益投资
- A curated list of awesome Qt and QML
- LeetCode 745. 前缀和后缀搜索
- Google Earth engine - Hansen global forest change v1.8 (2000-2020) forest coverage and forest loss data set
- pjudge#21652-[PR #4]到底有没有九【数位dp】
- Introduction to the universal theme system of SAP appgyver
- Déléguer un chargeur tel qu'un parent
- Hello JSON Schema
- An error, uncaught typeerror: modalfactory is not a constructor
猜你喜欢

如何在 RHEL 9 中更改和重置忘记的root密码

Keras深度学习实战(14)——从零开始实现R-CNN目标检测

Un modèle de détection par défaut basé sur le réseau neuronal évolutif rapide dans le contrôle de la qualité des produits - lire les notes

《MySQL DBA封神打怪之路》专栏学习大纲

How does unity3d use the asset store to download some useful resource packages

Unity高版本退回低版本报错问题

委派雙親之類加載器

Getting started with web security - deploy snort open source ids/ips system

466-82(3、146、215)
![[handwritten numeral recognition] handwritten numeral recognition based on lenet network with matlab code](/img/17/97b46355dbfa02608af2f91d7d6409.png)
[handwritten numeral recognition] handwritten numeral recognition based on lenet network with matlab code
随机推荐
ThreadLocal变量使用及原理
Daily question brushing record (26)
OA系统与MES系统的异同点
Mysql索引的类型(单列索引、组合索引 btree索引 聚簇索引等)
Goldfish rhca memoirs: cl210 describes the openstack control plane -- identify the overcloud control platform service + chapter experiment
An error, uncaught typeerror: modalfactory is not a constructor
剑指 Offer II 041. 滑动窗口的平均值
机器人开发--常用仿真软件工具
Introduction to replacement technology of SAP ABAP CDs view view
466-82(3、146、215)
设置cmd命令提示符窗口的界面语言为英文
每日刷题记录 (二十六)
数据库锁的介绍与InnoDB共享,排他锁
Keras deep learning practice (14) -- r-cnn target detection from scratch
性能优化之@Contended减少伪共享
SPI service discovery mechanism
Qt 两个重载QListWidget控件对象实现selectitem drag拖拽
Documents required for military product development process - advanced version
To get to the bottom: Principle Analysis of Objective-C correlation attribute
Data Guard Broker的概念和Data Guard Broker的配置过程