antvis / G

💥 A flexible rendering engine for visualization.
https://g.antv.antgroup.com/
1.04k stars 192 forks source link

使用 @antv/g-plugin-yoga,出现:Uncaught ReferenceError: _a is not defined at nbind.js:1146:62 #1668

Open cwwjsyc opened 2 months ago

cwwjsyc commented 2 months ago

`import { Canvas, Group, Rect, Text } from '@antv/g'; import { Renderer } from '@antv/g-canvas'; import { Plugin } from '@antv/g-plugin-yoga';

const renderer = new Renderer(); renderer.registerPlugin(new Plugin()); ` 出现 报错:

Uncaught ReferenceError: _a is not defined at nbind.js:1146:62 at nbind.js:1590:3 at node_modules/yoga-layout-prebuilt/yoga-layout/dist/entry-browser.js (entry-browser.js:21:1) at __require2 (chunk-3EJPJMEH.js?v=136e61d1:15:50) at entry-browser.js:40:40

xiaoiver commented 1 month ago

方便的话可以提供更多信息,例如使用的构建工具,看起来像是 vite?

gdnwr commented 1 month ago

@xiaoiver 6.0.6的官方示例(Yoga 排版引擎)也报错了。 https://g.antv.antgroup.com/zh/examples/plugins/yoga/#yoga-container

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at e.syncAttributes (umi.9da62fcc.js:1:1192269)
    at t.u (umi.9da62fcc.js:1:1189888)
    at e.notifyListeners (umi.9da62fcc.js:1:553778)
    at e.dispatchEvent (umi.9da62fcc.js:1:548440)
    at e.dispatchEvent (umi.9da62fcc.js:1:536258)
    at t.mountChildren (umi.9da62fcc.js:1:635832)
    at umi.9da62fcc.js:1:634731
    at e.init (umi.9da62fcc.js:1:555868)
    at t.initRenderingService (umi.9da62fcc.js:1:634388)
    at t.initRenderer (umi.9da62fcc.js:1:634141)
    at new t (umi.9da62fcc.js:1:629990)
    at <anonymous>:45:16
    at <anonymous>:17:5
    at <anonymous>:20:3
    at 2616.1e9f1e1a.async.js:1:52917
    at 2616.1e9f1e1a.async.js:1:52932
    at b (9399.ee29f7ce.async.js:1:730005)
    at k (9399.ee29f7ce.async.js:1:730286)
    at x (9399.ee29f7ce.async.js:1:730176)
xiaoiver commented 1 month ago

在 vite 下报错:

https://github.com/vadimdemedes/yoga-layout-prebuilt/issues/21

gdnwr commented 4 weeks ago

@xiaoiver 您好,官方文档中说:“该插件使用 yoga-layout-prebuilt,包体积较大,后续我们会使用自己开发的轻量版布局引擎。”,不知道是否有开发计划? https://g.antv.antgroup.com/plugins/yoga