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

**URL:** <https://discourse.threejs.org/t/angular-v17-browser-esbuild-cannot-use-modules-from-examples-jsm/60481>\
**Category:** Questions\
**Tags:** angular, modules\
**Created:** [January 18, 2024, 5:48pm UTC](https://discourse.threejs.org/t/angular-v17-browser-esbuild-cannot-use-modules-from-examples-jsm/60481 "2024-01-18T17:48:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarekDzw](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marekdzw/32/43958_2.png) [@MarekDzw](https://discourse.threejs.org/u/MarekDzw)\
**Post date:** [January 18, 2024, 5:48pm UTC](https://discourse.threejs.org/t/angular-v17-browser-esbuild-cannot-use-modules-from-examples-jsm/60481/1 "2024-01-18T17:48:29Z")

</div>

Hi,  
So currently building an app with new Angular builder `browser-esbuild` there are errors thrown that files imported from `three/examples/jsm` cannot be used. Is there any chance to change them to esmodules or any other workaround solution to this?

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [January 18, 2024, 5:58pm UTC](https://discourse.threejs.org/t/angular-v17-browser-esbuild-cannot-use-modules-from-examples-jsm/60481/2 "2024-01-18T17:58:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MarekDzw](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marekdzw/32/43958_2.png) [@MarekDzw](https://discourse.threejs.org/u/MarekDzw)\
**Post date:** [January 18, 2024, 8:31pm UTC](https://discourse.threejs.org/t/angular-v17-browser-esbuild-cannot-use-modules-from-examples-jsm/60481/3 "2024-01-18T20:31:27Z")

</div>

Thank for a fast and precise answer.  
Well, looks like adding extension - `.js` - to all imports made it work. Also, now I see that this wasn’t a  
Angular `esbuild` problem, which I thought it doesn’t allow CommonJS modules, and turns out it does allow them.  
Will also try the aliasing, as it also something nice to have.
