Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sonygod opened this issue Mar 16, 2022 · 5 comments
Open

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

sonygod opened this issue Mar 16, 2022 · 5 comments
Labels
bug Something isn't working three.js

Comments

@sonygod
Copy link

sonygod commented Mar 16, 2022

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)
@haxiomic
Copy link
Owner

haxiomic commented Mar 16, 2022

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

@sonygod
Copy link
Author

sonygod commented Mar 17, 2022

@haxiomic , your suggestions were wrong.

can you debug

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

x vaule is NaN.

@haxiomic
Copy link
Owner

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

@sonygod
Copy link
Author

sonygod commented Mar 17, 2022

same error BufferGeometryUtils

#114

thank you .it's work.

when will you release the next version dts2hx? haha

@haxiomic haxiomic added three.js bug Something isn't working labels Mar 17, 2022
@haxiomic
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working three.js
Projects
None yet
Development

No branches or pull requests

2 participants