Getting error in webpack react production mode. Working fine in development mode. I am using three.js and the error is coming this.orbiter = new THREE.OrbitControls(this, this.camera, this.canvasContainer, this);
in production mode this will change to this.orbiter = new (void 0)(this,this.camera,this.canvasContainer,this),
and will get this error.
I am using react@16, webpack@4.44 and three@0.112.1
TypeError: (void 0) is not a constructor
at CU.init (vk-ui-prod.c44e9123eae95b092aa3.min.js:397:128884)
at CU.componentDidMount (vk-ui-prod.c44e9123eae95b092aa3.min.js:397:120022)
at is (vk-ui-prod.c44e9123eae95b092aa3.min.js:377:83371)
at fl (vk-ui-prod.c44e9123eae95b092aa3.min.js:377:101245)
at t.unstable_runWithPriority (vk-ui-prod.c44e9123eae95b092aa3.min.js:385:3844)
at Br (vk-ui-prod.c44e9123eae95b092aa3.min.js:377:45023)
at pl (vk-ui-prod.c44e9123eae95b092aa3.min.js:377:97717)
at Qs (vk-ui-prod.c44e9123eae95b092aa3.min.js:377:93871)
at vk-ui-prod.c44e9123eae95b092aa3.min.js:377:45314
at t.unstable_runWithPriority (vk-ui-prod.c44e9123eae95b092aa3.min.js:385:3844)
e