Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

babel的loose模式会导致此模块在electron下无法加载 #27

Open
zsxeee opened this issue Sep 6, 2020 · 2 comments
Open

babel的loose模式会导致此模块在electron下无法加载 #27

zsxeee opened this issue Sep 6, 2020 · 2 comments

Comments

@zsxeee
Copy link

zsxeee commented Sep 6, 2020

Summary

如题,默认构建的 build/g2-plugin-slider.js:502subClass.prototype.constructor = subClass,为只读属性,语句无法操作成功。

Uncaught TypeError: Cannot assign to read only property 'constructor' of object '#<Group>'
    at _inheritsLoose (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:497)
    at eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:513)
    at Object.eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:909)
    at __webpack_require__ (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:25)
    at Object.eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:91)
    at __webpack_require__ (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:25)
    at Object.eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:75)
    at __webpack_require__ (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:25)
    at eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:68)
    at eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:71)

Environment

  • 依赖链:
ant-design-vue-pro@3.0.0
  ∟ viser-vue@2.4.8
      ∟ viser@2.4.9
          ∟ @antv/g2-plugin-slider@2.1.1
  • electron:
ares: "1.15.0"
brotli: "1.0.7"
chrome: "83.0.4103.122"
electron: "9.3.0"
http_parser: "2.8.0"
icu: "65.1"
llhttp: "2.0.1"
modules: "80"
napi: "5"
nghttp2: "1.40.0"
node: "12.14.1"
openssl: "1.1.0"
unicode: "12.1"
uv: "1.33.1"
v8: "8.3.110.13-electron.0"
zlib: "1.2.11"
@ouyongpeng
Copy link

解决了吗?我也遇到一样的问题

@zsxeee
Copy link
Author

zsxeee commented Jan 12, 2021

解决了吗?我也遇到一样的问题

没有,我直接移除了依赖。如果有需要的话建议使用其他同类库,或者按需求自行封装组件。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants