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] Error: init chart fail #3755

Open
tangzijun opened this issue Feb 23, 2025 · 8 comments
Open

[Bug] Error: init chart fail #3755

tangzijun opened this issue Feb 23, 2025 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@tangzijun
Copy link

Version

1.13.5

Link to Minimal Reproduction

1

Steps to Reproduce

1

Current Behavior

"next": "^15.1.7"
"react": "^19.0.0"

Image

Image

Expected Behavior

不报错

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@tangzijun tangzijun added the bug Something isn't working label Feb 23, 2025
@xiaoluoHe
Copy link
Contributor

检查一下 VChart 引入方式

// 默认的引入方式,可以直接使用,图表无需注册
import VChart from '@visactor/vchart';

// 引入VChart 核心模块,图表需要手动注册
import { VChart } from '@visactor/vchart';

ps. 按需加载文档

@tangzijun
Copy link
Author

检查一下 VChart 引入方式

// 默认的引入方式,可以直接使用,图表无需注册
import VChart from '@visactor/vchart';

// 引入VChart 核心模块,图表需要手动注册
import { VChart } from '@visactor/vchart';
ps. 按需加载文档

我报错时使用的是第一种方式,修改成第二种方式后,能够正常。

但第一种使用方式报错应该依然是一个问题。

@xiaoluoHe
Copy link
Contributor

@tangzijun 默认引入会报错的话是不太合理。请提供一个可以复现的 demo 吧

@LiuN1an
Copy link

LiuN1an commented Mar 7, 2025

+1, 最新版本我们也遇到了一样的问题,默认引入方式会报错“init fail”,必须通过第二种方式手动引入

@xiaoluoHe
Copy link
Contributor

xiaoluoHe commented Mar 18, 2025

+1, 最新版本我们也遇到了一样的问题,默认引入方式会报错“init fail”,必须通过第二种方式手动引入

@LiuN1an 请提供一下版本号信息、以及如何图表的使用方式,最好有复现 demo 好定位。
我在 v1.13.6 没有复现问题,demo: codesandbox

Image

@MingSeng-W
Copy link

我遇到同样的报错,vite, react. 在本地机器开发的好好的, 放到远程机器上就报错

Image

@MingSeng-W
Copy link

我遇到同样的报错,vite, react. 在本地机器开发的好好的, 放到远程机器上就报错

Image

改成import VChart from '@visactor/vchart'; 报错就解决了

@xiaoluoHe
Copy link
Contributor

xiaoluoHe commented Mar 24, 2025

我遇到同样的报错,vite, react. 在本地机器开发的好好的, 放到远程机器上就报错
Image

改成import VChart from '@visactor/vchart'; 报错就解决了

@MingSeng-W 你这个是因为之前用的按需方式引入的,本地开发环境 treeshaking 没生效;
改后是全量引入的,所以正常。
和 issue 原本问题不一样。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants