Angular v17 browser-esbuild cannot use modules from `examples/jsm/..`

These files are ES Modules, and should be compatible with ESBuild (in most configurations at least). For a better answer I think you may need to share more details, e.g. complete imports and the build tool configuration, tsconfig if applicable, etc. Any way to reproduce the issue. I assume three.js was installed with npm?

You might also try:

  • include .js extension on imports, e.g. three/examples/jsm/loaders/GLTFLoader.js
  • three/addons/... instead of three/examples/jsm/... … this is an alias using package.json#exports, some bundlers support the alias and others do not.
2 Likes