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

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

Open
devgeni opened this issue Aug 12, 2021 · 0 comments
Open

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

devgeni opened this issue Aug 12, 2021 · 0 comments

Comments

@devgeni
Copy link

devgeni commented Aug 12, 2021

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?

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