dts2hx icon indicating copy to clipboard operation
dts2hx copied to clipboard

[ERROR] Could not resolve "three/src/math/MathUtils"

Open sonygod opened this issue 2 years ago • 5 comments

three.js 138


import three.src.math.MathUtils;

	var x=180*MathUtils.DEG2RAD;
		trace(x);

after compile will get this error.

X [ERROR] Could not resolve "three/src/math/MathUtils"

    dist/main.js:64:39:
      64 │ var three_src_math_MathUtils = require("three/src/math/MathUtils");
         ╵                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~  

  The module "./src/math/MathUtils" was not found on the file system:
``
---------------------------

sources[ here](https://github.com/haxiomic/dts2hx/files/8264875/three138.zip)

sonygod avatar Mar 16 '22 15:03 sonygod

Hmm, looks like MathUtils has two exports, both Three.MathUtils and three/src/math/MathUtils and dts2hx need to choose just 1

For now a quick fix would be to replace the @:jsRequire in MathUtils.hx with @:jsRequire("three", "MathUtils")

Not ideal I know but I'll keep this issue in mind next time I work on dts2hx

haxiomic avatar Mar 16 '22 16:03 haxiomic

@haxiomic , your suggestions were wrong.

can you debug

var x=180*MathUtils.DEG2RAD;
	trace(x);

x vaule is NaN.

sonygod avatar Mar 17 '22 01:03 sonygod

My bad, I copied the wrong line, should be @:jsRequire("three", "MathUtils")

haxiomic avatar Mar 17 '22 01:03 haxiomic

same error BufferGeometryUtils

https://github.com/haxiomic/dts2hx/issues/114

thank you .it's work.

when will you release the next version dts2hx? haha

sonygod avatar Mar 17 '22 01:03 sonygod

Next version could take a while, my project schedule doesn't allow the time investment at the moment. Open to PRs if anyone want to make improvements in the near term!

haxiomic avatar Mar 17 '22 13:03 haxiomic