vasturiano / 3d-force-graph-vr

3D force-directed graph component in VR
https://vasturiano.github.io/3d-force-graph-vr/example/large-graph/
MIT License
228 stars 52 forks source link

Cannot read properties of undefined (reading 'xr') #45

Open AlexW00 opened 2 years ago

AlexW00 commented 2 years ago

Describe the bug Error when providing a nested HTML element as domNode:

plugin:obsidian-3d-graph:53529 Uncaught TypeError: Cannot read properties of undefined (reading 'xr')
    at HTMLElement.value (plugin:obsidian-3d-graph:53529:31)
    at HTMLElement.wrappedMethod (plugin:obsidian-3d-graph:52596:36)
    at gt (plugin:obsidian-3d-graph:2035:248)
    at st (plugin:obsidian-3d-graph:1988:15)
    at eval (plugin:obsidian-3d-graph:1996:37)
    at n2 (plugin:obsidian-3d-graph:2113:59)
    at MutationObserver.eval (plugin:obsidian-3d-graph:2118:82)

To Reproduce Steps to reproduce the behavior:

  1. const nestedHtmlElement = document.querySelector(#some-nested-object)
  2. this.instance = ForceGraphVR()(nestedHtmlElement).graphData(data);

Expected behavior It should work like the example code projects. But when providing an element other than body > div, it doesn't work.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

vasturiano commented 2 years ago

@AlexW00 thanks for reaching out.

I'm unable to replicate your issue. Would you mind making a simple example on https://codepen.io/ that shows your issue?