@schmoo2k I’m in the process of releasing a new version of d3-graphviz, but when I run the tests, I’m getting an error that I don’t understand:
RuntimeError: abort(ReferenceError: navigator is not defined). Build with -s ASSERTIONS=1 for more info.
at process.abort (/home/magjac/d3-graphviz/node_modules/@hpcc-js/wasm/dist/index.node.js:176:6623)
at process.emit (node:events:369:20)
at processEmit [as emit] (/home/magjac/d3-graphviz/node_modules/signal-exit/index.js:155:32)
at emit (node:internal/process/promises:135:22)
at processPromiseRejections (node:internal/process/promises:241:25)
at processTicksAndRejections (node:internal/process/task_queues:95:32)
It’s the same problem with any @hpcc-js/wasm version >= 1.0.0, but ok with 0.3.15.
I’ve tried nodejs version 10, 14 and 15 to no avail.
For whatever reason, I’m getting the same error in d3-zoom version 1.7.4 or later:
ReferenceError: navigator is not defined
at SVGSVGElement.defaultTouchable (/home/magjac/d3-graphviz/node_modules/d3-zoom/dist/d3-zoom.js:107:3)
at Selection.selection_filter [as filter] (/home/magjac/d3-graphviz/node_modules/d3-selection/dist/d3-selection.js:106:38)
at zoom (/home/magjac/d3-graphviz/node_modules/d3-zoom/dist/d3-zoom.js:144:8)
at Selection.selection_call [as call] (/home/magjac/d3-graphviz/node_modules/d3-selection/dist/d3-selection.js:329:12)
at Graphviz.createZoomBehavior (/home/magjac/d3-graphviz/build/d3-graphviz.js:1:341631)
at Graphviz._render (/home/magjac/d3-graphviz/build/d3-graphviz.js:24:2089)
at Graphviz.render (/home/magjac/d3-graphviz/build/d3-graphviz.js:19:204)
at Graphviz. (/home/magjac/d3-graphviz/test/data-test.js:23:17)
at Dispatch.call (/home/magjac/d3-graphviz/node_modules/d3-dispatch/dist/d3-dispatch.js:64:72)
at /home/magjac/d3-graphviz/build/d3-graphviz.js:27:377
@magjac - @hpcc-js/wasm ships with two different versions:
dist/index.js
dist/index.node.js
When loading in a browser (headless or not) then you should be using the “dist/index.js” version.
When loading in a NodeJS environment you should be using dist/index.node.js
I can’t really tell if your tests are running in a browser or not, but if they are you may be resolving to the wrong version?
Googling the error in question and it appears to be a NodeJS error, so my comment above would be irrelevent. But I don’t think I supported NodeJS prior to 1.0.0 - confused…
Thanks. The tests run in NodeJs through tape and uses jsdom and a lot of homecooked polyfills. Nothing in the tests has changed. It works without any problems with earlier versions of @hpcc-js/wasm and d3-zoom. I guess I just have to add more polyfills. If I can figure out which .
d3-zoom added the use of the navigator field in this commit.
@hpcc-js/wasm does not use it directly, but many of its dependencies do.