OrbitControls, Uncaught TypeError: b[c].call is not a function

When i use OrbitControls.js, i get following error console.log. Everythings works as expected as zoom, rotate but bug persists. Does anyone have this issue? How can i fix this?

Uncaught TypeError: b[c].call is not a function
    at THREE.OrbitControls.dispatchEvent (three.min.js:344)
    at THREE.OrbitControls.update (OrbitControls.js:232)
    at handleMouseMoveRotate (OrbitControls.js:495)
    at HTMLDocument.onMouseMove (OrbitControls.js:903)
dispatchEvent @ three.min.js:344
update @ OrbitControls.js:232
handleMouseMoveRotate @ OrbitControls.js:495
onMouseMove @ OrbitControls.js:903

Can you please demonstrate the issue with this live example: https://jsfiddle.net/hyok6tvj/

OrbitControls is already included. In this way, it’s easier to debug the runtime error.

updated fiddle : https://jsfiddle.net/volkanongun/nuhkx6r7/3/

Update fiddle: https://jsfiddle.net/s7fptue8/

Instead of

controls.addEventListener('change', renderer);

you have to code:

controls.addEventListener('change', render);

addEventListener() expects a function, not an instance of WebGLRenderer.

BTW: You really don’t need this line at all if you have an animation loop anyway:

https://jsfiddle.net/0rs6z98d/

Re-rendering the scene when the change event fires does only make sense when you have a static scene without any animated objects.

1 Like

:sweat: oh thanx so much for the help. its fixed