Giter Club home page Giter Club logo

Comments (9)

drcmda avatar drcmda commented on June 15, 2024 4

@Romaixn I recently encountered a similar issue on CodeSandbox. I managed to resolve it by updating ecctrl, drei, and fiber to the latest versions. Give it a try, let me know if it works for you 😁

@ErdongChen-Andrew i think it's this: https://github.com/pmndrs/ecctrl/blob/main/package.json#L32C1-L42C4

these should be peer dependencies. otherwise it's going to cause multiple three's, fiber's, drei's to be loaded. the issue is that ecctrl's context of fiber doesn't match the one of the main app, this happened due to version mismatch. the bundler just makes sure that ecctrl gets the exact fiber (and every other lib) that's declared in package.json.

imo it should be like this:

  "devDependencies": {
    "@types/react-dom": "^18.2.8",
    "@vitejs/plugin-react": "^4.1.0",
    "typescript": "^5.2.2",
    "vite": "^4.3.9"
  },
  "peerDependencies": {
    "@react-three/drei": ">=9.0",
    "@react-three/fiber": ">=8.0",
    "@react-three/rapier": ">=1.0",
    "react": ">=18.0",
    "react-dom": ">=18.0",
    "three": ">=0.133",
    "zustand": ">=4.0"
  },
  "dependencies": {
    "leva": "^0.9.34",
    "r3f-perf": "^7.1.2"
  }

i don't know about leva and r3f-perf. are these used for the debug view? in that case they could be "dependencies". if it's for local examples only they have to be "devDependencies"

btw erdong, would you like to be in pmndrs discord? https://discord.gg/poimandres a couple of people have asked for cctrl to have its own channel. this would make it easier to gather input or contributions/contributors. or figure out new api surfaces in small teams etc.

from ecctrl.

ErdongChen-Andrew avatar ErdongChen-Andrew commented on June 15, 2024

I'm using Vercel for my live demo and there is no error: https://character-control.vercel.app/
It would be really helpful if you could provide more detailed error messages.

from ecctrl.

Magvin avatar Magvin commented on June 15, 2024

@Romaixn can you eleborate what line of code it throws it?
What framework you use? React | Nextjs?

from ecctrl.

Romaixn avatar Romaixn commented on June 15, 2024

Oh, I see. It must be something on my end if it works for you on Vercel!
I'm using React with Vite.
Here's the URL to the Vercel deployment: https://zombie-runner.vercel.app (App error when loading 3D scene after welcome screen)

If I comment the <Ecctrl> Component my app work well in Vercel, of course, I don't have any issues during development... That's why it's really complicated to debug.

from ecctrl.

Magvin avatar Magvin commented on June 15, 2024

I do assume it complains about keyboard controls. Might be wrong you need to find out what he is trying to make with that useContext

image image

from ecctrl.

Romaixn avatar Romaixn commented on June 15, 2024

Indeed, that could be it... yet I have exactly the same configuration as in the demo: https://codesandbox.io/s/ecctrl-w-o-animations-3k3zxt?file=/src/App.js.
And when I remove just <Ecctrl> and leave <KeyboardControls>, everything works correctly.

I'll investigate a bit to see where the issue might be coming from

from ecctrl.

ErdongChen-Andrew avatar ErdongChen-Andrew commented on June 15, 2024

@Romaixn I recently encountered a similar issue on CodeSandbox. I managed to resolve it by updating ecctrl, drei, and fiber to the latest versions. Give it a try, let me know if it works for you 😁

from ecctrl.

dswhy avatar dswhy commented on June 15, 2024

I had the same problem and solved it by changing the dependencies above 👍 :)

Thanks @drcmda

from ecctrl.

ErdongChen-Andrew avatar ErdongChen-Andrew commented on June 15, 2024

👍 Thanks @drcmda! @CodyJasonBennett helped fix the npm config, and everything works perfectly now!
It would be great if ecctrl could have its own channel. I already in the discord, I just barely check messages there 😅.

from ecctrl.

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.