DB-GPT-Web icon indicating copy to clipboard operation
DB-GPT-Web copied to clipboard

[BUG] 使用@berryv/g2-react绘制图表时候,刷新报错

Open panxiaoxiao0823 opened this issue 1 year ago • 1 comments

` import { Chart } from '@berryv/g2-react';

{/* 图表测试 */} <Chart options={{ type: 'interval', width: 640, height: 480, data: [ { genre: 'Sports', sold: 275 }, { genre: 'Strategy', sold: 115 }, { genre: 'Action', sold: 120 }, { genre: 'Shooter', sold: 350 }, { genre: 'Other', sold: 150 }, ], encode: { x: 'genre', y: 'sold' }, }} />`

刷新就会报错 Server Error ReferenceError: exports is not defined in ES module scope This file is being treated as an ES module because it has a '.js' file extension and '/my/DB-GPT-Web-main/node_modules/@berryv/g2-react/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.

这是什么原因?

panxiaoxiao0823 avatar May 09 '24 13:05 panxiaoxiao0823

请问解决了吗

hellolixy avatar Jun 06 '24 06:06 hellolixy