data-set: [ts] Could not find a declaration file for module '@antv/data-set'
按照官方的指引安装,并引用报错
npm install @antv/data-set;
import DataSet from '@antv/data-set';
错误信息如下:
[ts]
Could not find a declaration file for module '@antv/data-set'. '/home/likewise-open/SENSETIME/liulin/sense-radar/node_modules/@antv/data-set/build/data-set.js' implicitly has an 'any' type.
Try `npm install @types/antv__data-set` if it exists or add a new declaration (.d.ts) file containing `declare module 'antv__data-set';`
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (4 by maintainers)
可以在项目里新建一个d.ts(比如 modules.d.ts) 文件 然后在里面写入
就可以解决ts编译不通过的问题
在 ts项目中报错,试试
按我的理解缺乏 type 定义文件并不会不能 work,这个报错只是开发时报错吧?我们没有使用 ts 技术栈,G2 的 ts 定义文件是社区提供的,如果有意帮助,欢迎 PR。