magjac / d3-graphviz

Graphviz DOT rendering and animated transitions using D3
BSD 3-Clause "New" or "Revised" License
1.67k stars 103 forks source link

webpack4 throw cannot resolve "@hpcc-js/wasm/graphviz" #298

Open linlinyang opened 8 months ago

linlinyang commented 8 months ago

Webpack4 not support export fields in package.json for '@hpcc-js/wasm'. So the use of 'import { Graphviz } from "@hpcc-js/wasm/graphviz";' will throw error.

  1. In d3-graphvis/src/dot.js and d3-graphvis/src/graphviz.js:
  2. Change to 'import wasm from "@hpcc-js/wasm";' .
  3. And change ' Graphviz.load()' to 'wasm .Graphviz.load()'
  4. will fixed this problem.