Class constructor Loader cannot be invoked without 'new'
Opened this issue · 2 comments
ingodahn commented
Calling a Vue component using ForceGraphVR I get the following error:
Uncaught TypeError: Class constructor Loader cannot be invoked without 'new'
at new THREE.DRACOLoader (3d-force-graph-vr:2)
at r.init (3d-force-graph-vr:83)
at r.t.exports.System (3d-force-graph-vr:83)
at new r (3d-force-graph-vr:83)
at HTMLElement.value (3d-force-graph-vr:83)
at HTMLElement.value (3d-force-graph-vr:83)
at HTMLElement.value (3d-force-graph-vr:83)
at HTMLElement.value (3d-force-graph-vr:83)
at g (3d-force-graph-vr:2)
at o (3d-force-graph-vr:2)
The main.html contains
<script src="https://unpkg.com/3d-force-graph-vr"></script>
<script src="https://unpkg.com/3d-force-graph"></script>
<script src="https://unpkg.com/force-graph"></script>
<script src="https://unpkg.com/d3-force"></script>
<script src="https://unpkg.com/three"></script>
Components are loaded in this sequence with vr first. each component is called with its own data object
vasturiano commented
@ingodahn I would try with the three
script as the first one above all the rest, if indeed you need it in your main html.
If the issue is Vue related I can't be of much help there, but if you can still reproduce it in vanilla JS, could you make an example on codepen.io?
ingodahn commented
Thanks, I removed the separate call to load three.js and the error is
gone.