xioxin / taro-f2

Taro多端F2图表
106 stars 21 forks source link

小程序编译提示canvasEl.addEventListener is not a function #41

Open kevinjie opened 4 years ago

kevinjie commented 4 years ago

我按照官方的示例使用,结果编译成小程序的时候出现以下错误,请问如何解决? 截屏2020-02-2717 43 47 截屏2020-02-2717 44 46

我的环境: "dependencies": { "@antv/f2": "^3.6.0-alpha.1", "@tarojs/components": "2.0.1", "@tarojs/components-qa": "2.0.1", "@tarojs/mobx": "2.0.1", "@tarojs/mobx-h5": "2.0.1", "@tarojs/router": "2.0.1", "@tarojs/taro": "2.0.1", "@tarojs/taro-alipay": "2.0.1", "@tarojs/taro-h5": "2.0.1", "@tarojs/taro-qq": "2.0.1", "@tarojs/taro-quickapp": "2.0.1", "@tarojs/taro-swan": "2.0.1", "@tarojs/taro-tt": "2.0.1", "@tarojs/taro-weapp": "2.0.1", "babel-runtime": "^6.26.0", "mobx": "4.8.0", "nerv-devtools": "^1.5.5", "nervjs": "^1.5.5", "taro-f2": "^2.2.0", "taro-ui": "^2.2.4" }, "devDependencies": { "babel-plugin-transform-runtime": "^6.23.0", "@types/react": "^16.4.6", "@types/webpack-env": "^1.13.6", "@tarojs/mini-runner": "2.0.1", "@tarojs/webpack-runner": "2.0.1", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-jsx-stylesheet": "^0.6.5", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-env": "^1.6.1", "babel-eslint": "^8.2.3", "eslint": "^5.16.0", "eslint-config-taro": "2.0.1", "eslint-plugin-react": "^7.8.2", "eslint-plugin-react-hooks": "^1.6.1", "eslint-plugin-import": "^2.12.0", "stylelint": "9.3.0", "stylelint-config-taro-rn": "2.0.1", "stylelint-taro-rn": "2.0.1", "eslint-plugin-taro": "2.0.1", "@typescript-eslint/eslint-plugin": "^2.13.0", "@typescript-eslint/parser": "^2.13.0", "typescript": "^3.0.1" }

BODhaha commented 4 years ago

请问你解决了吗@kevinjie

kevinjie commented 4 years ago

请问你解决了吗@kevinjie

没有

edwards19900128 commented 4 years ago

有解答了么。。。

sillyhong commented 4 years ago

本人解决方案:npm包降级"@antv/f2": "^3.1.22"

如题主截图所示,高版本的@antv/f2最后打包出来的文件中包含了dom事件监听,小程序不兼容

BoringDays commented 4 years ago

这样一直靠旧版吊命也不是办法,还是得看看有什么办法保证和新版f2接轨才行

lechenging commented 4 years ago

@sillyhong 更换3.1.22版本后,小程序图表不现实了

hana333 commented 4 years ago

@sillyhong 降级后滚动条interaction/pan,ScrollBar用不了。。有什么别的好的办法么?

lucky126 commented 4 years ago

3.1.22降级不了,yarn失败了

BarleyBig commented 4 years ago

看了一下f2的日志,是在3.6的时候新增了一些事件,然后降级到了3.5,可以正确编译运行 f2更新日志