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

自定义react节点报错 #4697

Closed
Hemomoo opened this issue Jun 30, 2023 · 7 comments
Closed

自定义react节点报错 #4697

Hemomoo opened this issue Jun 30, 2023 · 7 comments

Comments

@Hemomoo
Copy link

Hemomoo commented Jun 30, 2023

Describe the bug

  1. 和3861 那个bug 一样的问题
  2. 电脑是m1芯片
    3 node 版本我也切换过
    看报错信息 是这个 yoga-layout-prebuilt 的问题

在yoga-layout-prebuilt github 中 也有人提了一个这个问题 vadimdemedes/yoga-layout-prebuilt#21

但是我在codesandbox 中没有重现这个问题
我用vite 重现创建一个项目也会有同样的错误

Your Example Website or App

Steps to Reproduce the Bug or Issue

  1. 用vite 创建一个react 的项目
  2. 安装@antv/g6-react-node
  3. 导入就会报错

Expected behavior

可以正常运行

Screenshots or Videos

image

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]
    "dependencies": {
    "@antv/g6-react-node": "^1.4.5",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
    },
    "devDependencies": {
    "@types/react": "^18.0.37",
    "@types/react-dom": "^18.0.11",
    "@vitejs/plugin-react": "^4.0.0",
    "eslint": "^8.38.0",
    "eslint-plugin-react": "^7.32.2",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.3.4",
    "vite": "^4.3.9"
    }

Additional context

No response

@Muxin-007
Copy link

我也遇到了这问题,您解决了吗

@guguji5
Copy link

guguji5 commented Aug 9, 2023

浪费了一下午2小时时间。一直调试还是报错。整理了个最小复现集

https://github.com/n9e/fe/tree/g6-crash-with-vite

git clone git@github.com:n9e/fe.git
git checkout -b g6-crash-with-vite origin/g6-crash-with-vite
npm install
npm run dev

访问localhost:8765/g6 即可复现(记得要用 g6-crash-with-vite 分支的代码哈)

@defghy
Copy link

defghy commented Feb 23, 2024

临时性解法:
使用patch,修改源码解决的。npm和pnpm都有patch功能

     }_nbind.addMethod = addMethod;function throwError(message) {
       throw new Error(message);
-    }_nbind.throwError = throwError;_nbind.bigEndian = false;_a = _typeModule(_typeModule), _nbind.Type = _a.Type, _nbind.makeType = _a.makeType, _nbind.getComplexType = _a.getComplexType, _nbind.structureList = _a.structureList;var BindType = function (_super) {
+    }_nbind.throwError = throwError;_nbind.bigEndian = false;var _a; _a = _typeModule(_typeModule), _nbind.Type = _a.Type, _nbind.makeType = _a.makeType, _nbind.getComplexType = _a.getComplexType, _nbind.structureList = _a.structureList;var BindType = function (_super) {
       __extends(BindType, _super);function BindType() {
         var _this = _super !== null && _super.apply(this, arguments) || this;_this.heap = HEAPU32;_this.ptrSize = 4;return _this;
       }BindType.prototype.needsWireRead = function (policyTbl) {

_a前面加个var

@kanocence
Copy link

临时性解法: 使用patch,修改源码解决的。npm和pnpm都有patch功能

     }_nbind.addMethod = addMethod;function throwError(message) {
       throw new Error(message);
-    }_nbind.throwError = throwError;_nbind.bigEndian = false;_a = _typeModule(_typeModule), _nbind.Type = _a.Type, _nbind.makeType = _a.makeType, _nbind.getComplexType = _a.getComplexType, _nbind.structureList = _a.structureList;var BindType = function (_super) {
+    }_nbind.throwError = throwError;_nbind.bigEndian = false;var _a; _a = _typeModule(_typeModule), _nbind.Type = _a.Type, _nbind.makeType = _a.makeType, _nbind.getComplexType = _a.getComplexType, _nbind.structureList = _a.structureList;var BindType = function (_super) {
       __extends(BindType, _super);function BindType() {
         var _this = _super !== null && _super.apply(this, arguments) || this;_this.heap = HEAPU32;_this.ptrSize = 4;return _this;
       }BindType.prototype.needsWireRead = function (policyTbl) {

_a前面加个var

👍patch可以,但是感觉要放弃antv了🤣

@hxz1993
Copy link

hxz1993 commented Mar 6, 2024

临时性解法: 使用patch,修改源码解决的。npm和pnpm都有patch功能

     }_nbind.addMethod = addMethod;function throwError(message) {
       throw new Error(message);
-    }_nbind.throwError = throwError;_nbind.bigEndian = false;_a = _typeModule(_typeModule), _nbind.Type = _a.Type, _nbind.makeType = _a.makeType, _nbind.getComplexType = _a.getComplexType, _nbind.structureList = _a.structureList;var BindType = function (_super) {
+    }_nbind.throwError = throwError;_nbind.bigEndian = false;var _a; _a = _typeModule(_typeModule), _nbind.Type = _a.Type, _nbind.makeType = _a.makeType, _nbind.getComplexType = _a.getComplexType, _nbind.structureList = _a.structureList;var BindType = function (_super) {
       __extends(BindType, _super);function BindType() {
         var _this = _super !== null && _super.apply(this, arguments) || this;_this.heap = HEAPU32;_this.ptrSize = 4;return _this;
       }BindType.prototype.needsWireRead = function (policyTbl) {

_a前面加个var

👍patch可以,但是感觉要放弃antv了 🤣

可以发一下你那边patch 如何写的吗

@kanocence
Copy link

临时性解法: 使用patch,修改源码解决的。npm和pnpm都有patch功能

     }_nbind.addMethod = addMethod;function throwError(message) {
       throw new Error(message);
-    }_nbind.throwError = throwError;_nbind.bigEndian = false;_a = _typeModule(_typeModule), _nbind.Type = _a.Type, _nbind.makeType = _a.makeType, _nbind.getComplexType = _a.getComplexType, _nbind.structureList = _a.structureList;var BindType = function (_super) {
+    }_nbind.throwError = throwError;_nbind.bigEndian = false;var _a; _a = _typeModule(_typeModule), _nbind.Type = _a.Type, _nbind.makeType = _a.makeType, _nbind.getComplexType = _a.getComplexType, _nbind.structureList = _a.structureList;var BindType = function (_super) {
       __extends(BindType, _super);function BindType() {
         var _this = _super !== null && _super.apply(this, arguments) || this;_this.heap = HEAPU32;_this.ptrSize = 4;return _this;
       }BindType.prototype.needsWireRead = function (policyTbl) {

_a前面加个var

👍patch可以,但是感觉要放弃antv了 🤣

可以发一下你那边patch 如何写的吗

image

只需要加上 var _a; 直接复制上面老哥的就可以

@Aarebecca
Copy link
Contributor

@antv/g6-react-node 已不再维护,请使用 @antv/g6-extension-react (需要 G6 >= 5.0)

@Aarebecca Aarebecca closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2024
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

7 participants