Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
panxiaoxiao0823 opened this issue May 9, 2024 · 1 comment
Open

Comments

@panxiaoxiao0823
Copy link

`
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.

这是什么原因?

@hellolixy
Copy link

请问解决了吗

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

No branches or pull requests

2 participants