Comments (9)
@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.
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.
@Romaixn can you eleborate what line of code it throws it?
What framework you use? React | Nextjs?
from ecctrl.
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.
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
from ecctrl.
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.
@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.
I had the same problem and solved it by changing the dependencies above 👍 :)
Thanks @drcmda
from ecctrl.
👍 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)
- Mobile version spins the character model when zooming in HOT 4
- Can be support TransformControls? HOT 3
- Can I change the followCam position? HOT 2
- Use Animations from an external FBX file? HOT 1
- JoystickDis joystickAng HOT 5
- Is it possible to disable character movements? HOT 1
- Is there a way to access to object position data un useFrame? HOT 4
- The "PositionalAudio" component's position setting is no longer effective; the sound always stays nearby. HOT 3
- Is it possible to implement this additionally for phones and tablets outside the keyboard controls? HOT 2
- How to position the player character other than at the starting position? HOT 1
- Character spinning wildly and then flying off and losing context HOT 1
- How to get position of current character HOT 2
- ecctrlRef.current.translation() causes null pointer HOT 1
- Cannot find module 'ecctrl'" indicates that TypeScript cannot find the declaration file for the 'ecctrl' module. HOT 3
- Optional jumpIdle is not optional HOT 2
- How to define the character/player collision box/cuboid? HOT 11
- multiplayer online functionality HOT 1
- Cannot read properties of undefined (reading 'reset') TypeError: Cannot read properties of undefined (reading 'reset') HOT 2
- node modules file error on 1.0.78 HOT 6
- Keep camera in primary scene HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecctrl.