ReferenceError using Neovis.js in NextJS App

27 views Asked by At

I'm trying to create a graph using NeoVis in a React/NextJS app, but I'm getting the following error when trying to load the page.

[0] - error node_modules/neovis.js/dist/neovis.js (2:192) @ eval
[0] - error ReferenceError: self is not defined
[0]     at __webpack_require__ (PROJECTPATH/.next/server/webpack-runtime.js:33:42)
[0]     at eval (./app/NeoGraph.tsx:11:82)
[0]     at (sc_client)/./app/NeoGraph.tsx (PROJECTPATH/.next/server/app/page.js:4381:1)
[0]     at __webpack_require__ (PROJECTPATH/.next/server/webpack-runtime.js:33:42)
[0]     at eval (./app/page.tsx:10:67)
[0]     at (sc_client)/./app/page.tsx (PROJECTPATH/.next/server/app/page.js:4392:1)
[0]     at __webpack_require__ (PROJECTPATH/.next/server/webpack-runtime.js:33:42)
[0] null

My code matches this example on GitHub almost exactly (I changed the node and relationship names to match my DB)

https://github.com/jackdbd/react-neovis-example/blob/master/src/components/NeoGraph.js

I've tried importing the module without and with bundled dependency (import NeoVis from 'neovis.js' vs. import NeoVis from 'neovis.js/dist/neovis.js', but I got the same error

0

There are 0 answers