Giter VIP home page Giter VIP logo

Comments (2)

00155837364765867 avatar 00155837364765867 commented on May 28, 2024 1

Hi,
Thanks for your quick response!

Do you confirm that you have more than one instance of that module installed in your app?
Well, the behaviour of the exception would suggest there is more than one instance being loaded (but only after a second is referenced at runtime).

you might be better off just importing the module specific to the mode you're using to circumvent this issue
Yes, that is indeed what I do:
import { ForceGraph2D } from 'react-force-graph';

I got it working by removing react-force-graph and using the standalone package react-force-graph-2d.

I had missed this important sentence on your main page:

For dependency convenience, all of the components are also available as stand-alone packages: react-force-graph-2d, react-force-graph-3d, react-force-graph-vr and react-force-graph-ar.

Once I did that and cleaned my node_modules, it removed all the aframe stuff.
This certainly skirts 'round my symptom (thank for your pointer!) but I suppose the underlying issue remains, I guess it is what it is using global registries!

Thank you for your help, and more importantly for your excellent module!

from react-force-graph.

vasturiano avatar vasturiano commented on May 28, 2024

@00155837364765867 this is likely related to multiple modules of A-Frame in your dependency tree.

Do you confirm that you have more than one instance of that module installed in your app?

If so, that's probably the source of the issue, due to the side-effects that that particular module has:
https://aframe.io/docs/1.5.0/core/globals.html#aframe_properties_anode

Are you actually using the VR mode in your app? If you're not, you might be better off just importing the module specific to the mode you're using to circumvent this issue. F.e. if you want to just import the 3D mode:

import ForceGraph3D from 'react-force-graph-3d';

from react-force-graph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.