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

Could not resolve "three/examples/jsm/exporters/GLTFExporter" while building three.js app #23696

Closed
soadzoor opened this issue Mar 10, 2022 · 4 comments

Comments

@soadzoor
Copy link
Contributor

soadzoor commented Mar 10, 2022

Describe the bug

I upgraded my app from r137 to r138, and since then I have the following errors (a lot of similar ones):
Screenshot 2022-03-10 at 15 43 24

I checked the migration guide (137->138), but it seems it doesn't say anything about this. The strange thing, is that the files are still there, so I don't know why it says "it was not found". I'm using esbuild for bundling the js file, if that matters (but it worked flawlessly with r137, so I'm pretty sure something has changed with three.js, not esbuild ).

Does anyone has an idea what might be the problem?
Thanks

@soadzoor
Copy link
Contributor Author

(might be related to this one? I don't know: #23625 )

@marcofugaro
Copy link
Contributor

@soadzoor if you use esbuild, it requires you to import using the .js extension as the ESModule spec says:

import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'

@soadzoor
Copy link
Contributor Author

@marcofugaro Hm, that seems to be working, thanks. But still not sure what changed. 🤔

@marcofugaro
Copy link
Contributor

But still not sure what changed. 🤔

three.js is now a proper ES Module 🙂

"type": "module",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants