GGEditor icon indicating copy to clipboard operation
GGEditor copied to clipboard

ERROR when using with Next.js. GGEditor is no longer maintained?

Open devgeni opened this issue 3 years ago • 0 comments

I'm trying to import gg-editor components inside next.js app and getting this error.

import GGEditor, { Mind } from 'gg-editor';

const data = {
  label: 'Central Topic',
  children: [
    {
      label: 'Main Topic 1',
    },
    {
      label: 'Main Topic 2',
    },
    {
      label: 'Main Topic 3',
    },
  ],
};

export const Mindmap = (props) => {
  return (
    <GGEditor>
      <Mind data={data} />
    </GGEditor>
  );
};
ReferenceError: document is not defined
    at Object.<anonymous> (/node_modules/@antv/g6/lib/behavior/drag-node-with-group.js:23:12)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/node_modules/@antv/g6/lib/behavior/index.js:30:49)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/node_modules/@antv/g6/lib/index.js:42:40)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)

It's clear that the error is coming from @antv/g6 lib. Probably because gg-editor depends on the old version of @antv/g6 which is ^3.5.0. But the latest version of @antv/g6 is 4.3.5.

So... Is this project abandoned? If it really is then could someone suggest me any similar library that people use instead of gg-editor?

devgeni avatar Aug 12 '21 16:08 devgeni