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

V5版本Cannot read properties of undefined (reading 'getContext') #5081

Closed
ferrydjing opened this issue May 24, 2023 · 0 comments
Closed

V5版本Cannot read properties of undefined (reading 'getContext') #5081

ferrydjing opened this issue May 24, 2023 · 0 comments

Comments

@ferrydjing
Copy link

ferrydjing commented May 24, 2023

version: @antv/g2@5.0.8

使用antv/g2最新版本,按照官网的示例,不能正确显示图表,出现报错
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getContext')
at Canvas2DContextService._callee$ (index.esm.js:438:41)
at tryCatch (index.esm.js:107:17)
at Generator.eval (index.esm.js:186:22)
at Generator.eval [as next] (index.esm.js:131:21)
at asyncGeneratorStep (index.esm.js:362:24)
at _next (index.esm.js:380:9)
at eval (index.esm.js:385:7)
at new Promise ()
at Canvas2DContextService.eval (index.esm.js:377:12)
at Canvas2DContextService.init (index.esm.js:447:20)
at Canvas._callee2$ (index.esm.js:11932:48)
at tryCatch (index.esm.js:803:17)
at Generator.eval (index.esm.js:882:22)
at Generator.eval [as next] (index.esm.js:827:21)
at asyncGeneratorStep (index.esm.js:1058:24)
at _next (index.esm.js:1076:9)
at eval (index.esm.js:1081:7)
at new Promise ()
at Canvas.eval (index.esm.js:1073:12)
at Canvas.initRenderer (index.esm.js:11957:28)
at _callee$ (index.esm.js:11766:26)
at tryCatch (index.esm.js:803:17)
at Generator.eval (index.esm.js:882:22)
at Generator.eval [as next] (index.esm.js:827:21)
at asyncGeneratorStep (index.esm.js:1058:24)
at _next (index.esm.js:1076:9)
at eval (index.esm.js:1081:7)
at new Promise ()
at eval (index.esm.js:1073:12)
at new Canvas (index.esm.js:11777:8)
at Chart.render (chart.js:106:30)
at Proxy.initChart (HelloWorld.vue:35:13)
at eval (HelloWorld.vue:40:12)

在线demo:https://codesandbox.io/s/tender-sound-3wj23e?file=/src/components/HelloWorld.vue

@ferrydjing ferrydjing changed the title Cannot read properties of undefined (reading 'getContext') V5版本Cannot read properties of undefined (reading 'getContext') May 24, 2023
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

1 participant