Modules (or circular dependencies) broken in 85?

Description of the problem

Using anything in THREE, even if it’s just a Vector

import { Vector3 } from 'three/src/Three';
console.log(Vector3)

causes:

vendor.js:53016 Uncaught TypeError:
    __WEBPACK_IMPORTED_MODULE_0__Vector3__.a is not a constructor

for instance somewhere in Quaternion, which relies on Vector3.

    setFromUnitVectors: function () {

        // http://lolengine.net/blog/2014/02/24/quaternion-from-two-vectors-final

        // assumes direction vectors vFrom and vTo are normalized
>>>>>>> var v1 = new __WEBPACK_IMPORTED_MODULE_0__Vector3__["a" /* Vector3 */]();

It looks like for some reason it can’t resolve circular dependencies any longer, the internal require returns an empty object. It breaks r85 for module users. The only change i made was updating from 84 to 85.

Three.js version
  • r85
Browser
  • Chrome
OS
  • macOS
Build tool
  • Webpack 2.4.1

Author: Fantashit

1 thought on “Modules (or circular dependencies) broken in 85?

  1. @drcmda nope it’s not just quaternion:

    revert closure optimisations pr

    This works for me.

    But rather than revert those otherwise sensible optimisations though, perhaps there’s a way we can “have our cake and eat it” – perhaps @TristanVALCKE has a suggestion since I’ve not run the benchmarks

Comments are closed.