用脚手架create-react-app 创建react18后,下载 antv@g2, 引用
import { Chart } from '@antv/g2';
项目启动就报错如图
ERROR in ./node_modules/@antv/component/esm/util/offscreen.js
ERROR in ./node_modules/@antv/component/esm/util/offscreen.js
解决:
npm install tslib -S
用脚手架create-react-app 创建react18后,下载 antv@g2, 引用
import { Chart } from '@antv/g2';
项目启动就报错如图
ERROR in ./node_modules/@antv/component/esm/util/offscreen.js
ERROR in ./node_modules/@antv/component/esm/util/offscreen.js
解决:
npm install tslib -S