Error - Unhandled promise rejection while using Neovis.js

performance
browser
cypher
operations
knowledge-base

(Sucheta) #1

Hi,

Is there any way to hit a Neovis twice or more than once in a program. Because i use Neovis.js code in two of my angular functions -

EwayBill() and Collection(). Both have Neovis.js code but different cypher queries. On page load , i want both the respective outputs of EwayBill and Collection Nodes. But that doesn't happen and i get the output -


Unhandled promise rejection TypeError: Cannot read property 'hasChildNodes' of null
    at t.value (neovis.js:35248)
    at new n (neovis.js:35243)
    at Object.onCompleted (neovis.js:36674)
    at eval (neovis.js:34269)
    at run (neovis.js:11126)
    at eval (neovis.js:11139)
    at MutationObserver.flush (neovis.js:10385)
    at ZoneDelegate.invoke (zone.js:388)
    at Object.onInvoke (core.js:4062)
    at ZoneDelegate.invoke (zone.js:387)
(anonymous) @ neovis.js:11156
perform @ neovis.js:11098
(anonymous) @ neovis.js:11150
run @ neovis.js:35611
runIfPresent @ neovis.js:35640
onGlobalMessage @ neovis.js:35680
ZoneDelegate.invokeTask @ zone.js:421
onInvokeTask @ core.js:4053
ZoneDelegate.invokeTask @ zone.js:420
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
postMessage (async)
registerImmediate @ neovis.js:35691
setImmediate @ neovis.js:35598
onUnhandled @ neovis.js:11146
(anonymous) @ neovis.js:11142
flush @ neovis.js:10385
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4062
ZoneDelegate.invoke @ zone.js:387
Zone.runGuarded @ zone.js:151
(anonymous) @ zone.js:129
characterData (async)
notify @ neovis.js:10406
(anonymous) @ neovis.js:10432
notify @ neovis.js:11107
then @ neovis.js:11253
_releaseConnection @ neovis.js:30699
releaseConnection @ neovis.js:30666
onCompletedWrapper @ neovis.js:34268
onCompleted @ neovis.js:33050
onCompleted @ neovis.js:34765
_handleMessage @ neovis.js:31459
Connection._dechunker.onmessage @ neovis.js:31404
_onHeader @ neovis.js:30549
AWAITING_CHUNK @ neovis.js:30502
write @ neovis.js:30560
self._ch.onmessage @ neovis.js:31377
WebSocketChannel._ws.onmessage @ neovis.js:30217
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
onInvokeTask @ core.js:4053
ZoneDelegate.invokeTask @ zone.js:420
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
    invokeTask @ zone.js:1540
   globalZoneAwareCallback @ zone.js:1566

Now to avoid the above error i tried to change the code for HTML page in EwayBill() and Collection(). I changed a little code and defined EwayBill output as -

    this.vizEwayBill = new NeoVis.default(config);
    this.vizEwayBill.render();
    console.log(this.vizEwayBill);

And to Collection output as -

       this.vizCollection = new NeoVis.default(config);
      this.vizCollection.render();
      console.log(this.vizCollection);

Instead of this -

     this.viz = new NeoVis.default(config);
     this.viz.render();
     console.log(this.viz);

But i still get error -


Unhandled promise rejection TypeError: Cannot read property 'hasChildNodes' of null
    at t.value (neovis.js:35248)
    at new n (neovis.js:35243)
    at Object.onCompleted (neovis.js:36674)
    at eval (neovis.js:34269)
    at run (neovis.js:11126)
    at eval (neovis.js:11139)
    at MutationObserver.flush (neovis.js:10385)
    at ZoneDelegate.invoke (zone.js:388)
    at Object.onInvoke (core.js:4062)
    at ZoneDelegate.invoke (zone.js:387)
(anonymous) @ neovis.js:11156
perform @ neovis.js:11098
(anonymous) @ neovis.js:11150
run @ neovis.js:35611
runIfPresent @ neovis.js:35640
onGlobalMessage @ neovis.js:35680
ZoneDelegate.invokeTask @ zone.js:421
onInvokeTask @ core.js:4053
ZoneDelegate.invokeTask @ zone.js:420
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
postMessage (async)
registerImmediate @ neovis.js:35691
setImmediate @ neovis.js:35598
onUnhandled @ neovis.js:11146
(anonymous) @ neovis.js:11142
flush @ neovis.js:10385
ZoneDelegate.invoke @ zone.js:388
onInvoke @ core.js:4062
ZoneDelegate.invoke @ zone.js:387
Zone.runGuarded @ zone.js:151
(anonymous) @ zone.js:129
characterData (async)
notify @ neovis.js:10406
(anonymous) @ neovis.js:10432
notify @ neovis.js:11107
then @ neovis.js:11253
_releaseConnection @ neovis.js:30699
releaseConnection @ neovis.js:30666
onCompletedWrapper @ neovis.js:34268
onCompleted @ neovis.js:33050
onCompleted @ neovis.js:34765
_handleMessage @ neovis.js:31459
Connection._dechunker.onmessage @ neovis.js:31404
_onHeader @ neovis.js:30549
AWAITING_CHUNK @ neovis.js:30502
write @ neovis.js:30560
self._ch.onmessage @ neovis.js:31377
WebSocketChannel._ws.onmessage @ neovis.js:30217
wrapFn @ zone.js:1188
ZoneDelegate.invokeTask @ zone.js:421
onInvokeTask @ core.js:4053
ZoneDelegate.invokeTask @ zone.js:420
Zone.runTask @ zone.js:188
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566

Note : Only when i use this declaration that i get the output-

     this.viz = new NeoVis.default(config);
     this.viz.render();
     console.log(this.viz);

When i searched for "viz" in neovis.js code, i don't get any result.

Please help. I want more that one output in my html page at once.


(William Lyon) #2

What is the value of config.container_id for each instance of Neovis? Are they the same? That error sounds like it's not able to find the container element for the visualization.


(Sucheta) #3

Thanks William . Its resolved