antvis / G6

♾ A Graph Visualization Framework in JavaScript.
https://g6.antv.antgroup.com/
MIT License
11.15k stars 1.33k forks source link

vue项目打包部署之后,g6报错 #2796

Closed lQei closed 3 years ago

lQei commented 3 years ago

Reproduction link

Edit on CodeSandbox

Steps to reproduce

在vue项目中,使用g6。开发环境正常。打包部署之后报错。报错如下: chunk-libs.1e4b3d2e.js:53 TypeError: undefined is not iterable! chunk-libs.1e4b3d2e.js:40 TypeError: Super expression must either be null or a function

Environment Info
g6 3.8.5
System win10
Browser Google Chrome 版本 86.0.4240.193(正式版本) (64 位)
Yanyan-Wang commented 3 years ago

vue 不是很清楚,先确定一下是否是因为 G6,去掉 G6 看下还会不会报错。https://gitmemory.com/issue/vuejs/composition-api/109/526837881

lQei commented 3 years ago

去掉G6的引入之后不会报错。只要有import G6 from '@antv/g6',就会报错

liqi007 commented 3 years ago

angular11 添加G6引用也报错

Error: node_modules/@antv/g6-core/lib/index.d.ts:1:23 - error TS2688: Cannot find type definition file for '_gl-matrix@3.3.0@gl-matrix'.

Yanyan-Wang commented 3 years ago

Angular 看这里:https://github.com/antvis/G6/issues/2691#issuecomment-788164317 https://g6.antv.vision/zh/docs/manual/FAQ/angular-support

liqi007 commented 3 years ago

删除\node_modules\@antv\g6-core\lib\util\index.d.ts和\node_modules\@antv\g6-core\lib\index.d.ts第一行后不报错能正常运行

Yanyan-Wang commented 3 years ago

删除\node_modules@antv\g6-core\lib\util\index.d.ts和\node_modules@antv\g6-core\lib\index.d.ts第一行后不报错能正常运行

为啥要删啊?看我发的链接里的解决方案

liqi007 commented 3 years ago

@Yanyan-Wang 链接中的解决方法不能解决问题

Yanyan-Wang commented 3 years ago

https://github.com/antvis/G6/issues/2691 这个 issue 应该跟你一样的,先 skipLibCheck: true,然后再按后面步骤来

Yanyan-Wang commented 3 years ago

由于您的 issue 长时间没有回复,我们无法根据你提供的信息给出解答,所以暂时关闭这个 issue。若有新的进展,可随时新开 issue。