1

I was trying to implent mxgraph in my next.js app but importing library throws error.

Is there any way to solve Reference Error if certain library doesn't handle undefined window or navigator?

  1 |import mx from "mxgraph";
  2 | 
> 3 | const mxgraph = mx({
    |                   ^
  4 |   mxBasePath: "/assets/mxgraph",
  5 | });

Here's my repo

juliomalves
  • 42,130
  • 20
  • 150
  • 146
loone96
  • 723
  • 2
  • 13
  • 21
  • 2
    Does this answer your question? [(Webpack) Why am I getting ReferenceError: self is not defined in Next.js when I try to import a client-side library?](https://stackoverflow.com/a/66100185/1870780) – juliomalves Oct 08 '21 at 23:08

0 Answers0