antvis / data-set

state driven all in one data process for data visualization.
MIT License
248 stars 46 forks source link

[ts] Could not find a declaration file for module '@antv/data-set' #43

Closed liuruomu closed 3 years ago

liuruomu commented 6 years ago

按照官方的指引安装,并引用报错

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';`
leungwensen commented 6 years ago

dataset 不是用 typescript 写的,目前也暂时没有 ts 定义文件,如果有兴趣可以帮我们整一个?

15502573620 commented 6 years ago

现在这个有解决方案了吗? @leungwensen 这个导致离线状态下没法使用g2组件,必须要用引入

leungwensen commented 6 years ago

按我的理解缺乏 type 定义文件并不会不能 work,这个报错只是开发时报错吧?我们没有使用 ts 技术栈,G2 的 ts 定义文件是社区提供的,如果有意帮助,欢迎 PR。

LingHunJuJuDuXing commented 5 years ago

好吧,这个确实没辙。好不容易说服前端组长不用echarts改用bizcharts。无奈项目要求必须用typescript。

leungwensen commented 5 years ago

@LingHunJuJuDuXing 抱歉~ g2 目前内部在做 4.0,底层数据处理、绘图等所有模块都已经用 ts 改写了。不过正式上线要等一段时间

liuruomu commented 5 years ago

👍👍发自我的华为手机-------- 原始邮件 --------主题:Re: [antvis/data-set] [ts] Could not find a declaration file for module '@antv/data-set' (#43)发件人:绝云 收件人:antvis/data-set 抄送:liulin ,Author @LingHunJuJuDuXing 抱歉~ g2 目前内部在做 4.0,底层数据处理、绘图等所有模块都已经用 ts 改写了。不过正式上线要等一段时间

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/antvis/data-set","title":"antvis/data-set","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/antvis/data-set"}},"updates":{"snippets":[{"icon":"PERSON","message":"@leungwensen in #43: @LingHunJuJuDuXing 抱歉~ g2 目前内部在做 4.0,底层数据处理、绘图等所有模块都已经用 ts 改写了。不过正式上线要等一段时间"}],"action":{"name":"View Issue","url":"https://github.com/antvis/data-set/issues/43#issuecomment-474696953"}}}

[

{

"@context": "http://schema.org",

"@type": "EmailMessage",

"potentialAction": {

"@type": "ViewAction",

"target": "https://github.com/antvis/data-set/issues/43#issuecomment-474696953",

"url": "https://github.com/antvis/data-set/issues/43#issuecomment-474696953",

"name": "View Issue"

},

"description": "View this Issue on GitHub",

"publisher": {

"@type": "Organization",

"name": "GitHub",

"url": "https://github.com"

}

}

]

hyytime commented 5 years ago

@LingHunJuJuDuXing 抱歉~ g2 目前内部在做 4.0,底层数据处理、绘图等所有模块都已经用 ts 改写了。不过正式上线要等一段时间

现在上线了吗

imzengyang commented 5 years ago

在 ts项目中报错,试试

const DataSet = require('@antv/data-set');
devcui commented 5 years ago

@LingHunJuJuDuXing 抱歉~ g2 目前内部在做 4.0,底层数据处理、绘图等所有模块都已经用 ts 改写了。不过正式上线要等一段时间

马上7月份了呀哥哥,

bigwolfdogroar commented 5 years ago

@LingHunJuJuDuXing 抱歉~ g2 目前内部在做 4.0,底层数据处理、绘图等所有模块都已经用 ts 改写了。不过正式上线要等一段时间

马上7月份了呀哥哥,

马上十月份了呀哥哥,

757566833 commented 4 years ago

@LingHunJuJuDuXing 抱歉~ g2 目前内部在做 4.0,底层数据处理、绘图等所有模块都已经用 ts 改写了。不过正式上线要等一段时间

马上7月份了呀哥哥,

马上十月份了呀哥哥,

马上十二月份了呀哥哥,

qykingle commented 4 years ago

还是不行,用require都不行

Jeffy2012 commented 4 years ago

可以在项目里新建一个d.ts(比如 modules.d.ts) 文件 然后在里面写入

declare module '@antv/data-set';

就可以解决ts编译不通过的问题

15502573620 commented 4 years ago

别抄送我了,我已经解决之前的问题了,而且这是一年前的事情了

------------------ 原始邮件 ------------------ 发件人: "Jeffy"<notifications@github.com>; 发送时间: 2019年12月9日(星期一) 中午11:34 收件人: "antvis/data-set"<data-set@noreply.github.com>; 抄送: "799415090"<799415090@qq.com>; "Comment"<comment@noreply.github.com>; 主题: Re: [antvis/data-set] [ts] Could not find a declaration file for module '@antv/data-set' (#43)

可以在项目里新建一个d.ts(比如 modules.d.ts) 文件 然后在里面写入 declare module '@antv/data-set';

就可以解决ts编译不通过的问题

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

cp1001 commented 3 years ago

可以在项目里新建一个d.ts(比如 modules.d.ts) 文件 然后在里面写入

declare module '@antv/data-set';

就可以解决ts编译不通过的问题

这个解决方案很棒,很多库都有这种问题,最好的解决方案就是在一个文件中申明下。