antvis / G6

♾ A Graph Visualization Framework in JavaScript.
https://g6.antv.antgroup.com/
MIT License
11.16k stars 1.33k forks source link

Production Environment Error: Cannot read properties of undefined (reading 'Graph') #6512

Closed hls-1992 closed 1 week ago

hls-1992 commented 1 week ago

Describe the bug / 问题描述

In DEV environment, everything is ok. In PROD environmnet, Cannot read properties of undefined (reading 'Graph')

Reproduction link / 重现链接

No response

Steps to Reproduce the Bug or Issue / 重现步骤

Just vue3 + vite import { Graph } from '@antv/g6'

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

macOS

Browser / 浏览器

Chrome

Additional context / 补充说明

No response

hls-1992 commented 1 week ago

vite 2.x version

Aarebecca commented 1 week ago

I created a vue app and used G6, and the built product worked without the problem you described. You can provide more information.

hls-1992 commented 1 week ago

I created a vue app and used G6, and the built product worked without the problem you described. You can provide more information.

I think it is caused by the lower version vite(2.6)

hls-1992 commented 1 week ago

I created a vue app and used G6, and the built product worked without the problem you described. You can provide more information.

In vite 4.x version, everything is ok