基于 element-ui和 antv/g6 4.x 二次封装了一个组件库,G6 的组件直接引入import G6 from '@antv/g6';
发布 npm 包的时候,如果导出的组件含有使用 g6的组件,其他项目下载使用,浏览器会提示如下错误:
main.js:142 TypeError: Class extends value undefined is not a constructor or null
at t (tslib.es6.js:35:264)
at eval (circle.js:6:180)
at Proxy.eval (circle.js:6:831)
at ./node_modules/.pnpm/@luban-fe-ui+components@0.1.7/node_modules/@luban-fe-ui/components/dist/esm/node_modules/.pnpm/@antv_g-canvas@0.5.17/node_modules/@antv/g-canvas/esm/shape/circle.js (overview.js:4666:1)
at webpack_require__ (runtime.js:854:30)
at fn (runtime.js:151:20)
at Proxy.eval (arrow.js:7:74)
at ./node_modules/.pnpm/@luban-fe-ui+components@0.1.7/node_modules/@luban-fe-ui/components/dist/esm/node_modules/.pnpm/@antv_g-canvas@0.5.17/node_modules/@antv/g-canvas/esm/util/arrow.js (overview.js:4810:1)
at webpack_require__ (runtime.js:854:30)
at fn (runtime.js:151:20)
Describe the bug / 问题描述
基于 element-ui和 antv/g6 4.x 二次封装了一个组件库,G6 的组件直接引入import G6 from '@antv/g6'; 发布 npm 包的时候,如果导出的组件含有使用 g6的组件,其他项目下载使用,浏览器会提示如下错误: main.js:142 TypeError: Class extends value undefined is not a constructor or null at t (tslib.es6.js:35:264) at eval (circle.js:6:180) at Proxy.eval (circle.js:6:831) at ./node_modules/.pnpm/@luban-fe-ui+components@0.1.7/node_modules/@luban-fe-ui/components/dist/esm/node_modules/.pnpm/@antv_g-canvas@0.5.17/node_modules/@antv/g-canvas/esm/shape/circle.js (overview.js:4666:1) at webpack_require__ (runtime.js:854:30) at fn (runtime.js:151:20) at Proxy.eval (arrow.js:7:74) at ./node_modules/.pnpm/@luban-fe-ui+components@0.1.7/node_modules/@luban-fe-ui/components/dist/esm/node_modules/.pnpm/@antv_g-canvas@0.5.17/node_modules/@antv/g-canvas/esm/util/arrow.js (overview.js:4810:1) at webpack_require__ (runtime.js:854:30) at fn (runtime.js:151:20)
Reproduction link / 重现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
No response
G6 Version / G6 版本
4.x
Operating System / 操作系统
macOS
Browser / 浏览器
Chrome
Additional context / 补充说明
rollup.config.js
package.json