# WARNING: Multiple instances of Three.js being imported. (?)

**URL:** <https://discourse.threejs.org/t/warning-multiple-instances-of-three-js-being-imported/24191>\
**Category:** Questions\
**Tags:** modules\
**Created:** [March 8, 2021, 11:02pm UTC](https://discourse.threejs.org/t/warning-multiple-instances-of-three-js-being-imported/24191 "2021-03-08T23:02:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DatsGabs](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/datsgabs/32/16896_2.png) [@DatsGabs](https://discourse.threejs.org/u/DatsGabs)\
**Post date:** [March 8, 2021, 11:02pm UTC](https://discourse.threejs.org/t/warning-multiple-instances-of-three-js-being-imported/24191/1 "2021-03-08T23:02:07Z")

</div>

Why is this showing in the console when I import three.module.js and OrbitControls.js  
Literally this 2 lines of code.

```javascript
<script type="module">
    import * as THREE from 'https://unpkg.com/three/build/three.module.js';
    import { OrbitControls } from "https://threejs.org/examples/jsm/controls/OrbitControls.js";	
</script>

```

---

<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:** [March 9, 2021, 12:51am UTC](https://discourse.threejs.org/t/warning-multiple-instances-of-three-js-being-imported/24191/2 "2021-03-09T00:51:30Z")

</div>

See the “Examples” section on this page:

[https://threejs.org/docs/#manual/en/introduction/Installation](https://threejs.org/docs/#manual/en/introduction/Installation)

When importing different parts of the three.js library from a CDN, it’s important to import consistently from the same CDN. The version of OrbitControls hosted on one domain depends on THREE from that same domain, so in this case the `THREE` library is being imported both from `unpkg.com` and from `threejs.org`.

Instead, try:

```javascript
import * as THREE from 'https://unpkg.com/three@0.126.1/build/three.module.js';
import { OrbitControls } from 'https://unpkg.com/three@0.126.1/examples/jsm/controls/OrbitControls.js';

```

---

<div class="post-metadata">

**Author:** ![DatsGabs](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/datsgabs/32/16896_2.png) [@DatsGabs](https://discourse.threejs.org/u/DatsGabs)\
**Post date:** [March 9, 2021, 1:31am UTC](https://discourse.threejs.org/t/warning-multiple-instances-of-three-js-being-imported/24191/3 "2021-03-09T01:31:07Z")

</div>

Still warning :((

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/1/f/1f61b4082232304c476f67e379b0c67503b1b23a.png) ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/3/0/30fab4eb2023a79dae975af2cb9411eaee7573de.png)

---

<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:** [March 9, 2021, 1:47am UTC](https://discourse.threejs.org/t/warning-multiple-instances-of-three-js-being-imported/24191/4 "2021-03-09T01:47:35Z")

</div>

Those are not the same URLs I suggested — by omitting a version (e.g. `@0.126.1`) the CDN will redirect both URLs and ultimately include two copies of the library again. I’d strongly recommend pinning to a specific version of three.js rather than having it update underneath you, but if you’d prefer not to do that then the `threejs.org` URL is the one to use.

---

<div class="post-metadata">

**Author:** ![PhilipZhu](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/philipzhu/32/36154_2.png) [@PhilipZhu](https://discourse.threejs.org/u/PhilipZhu)\
**Post date:** [May 11, 2023, 3:04am UTC](https://discourse.threejs.org/t/warning-multiple-instances-of-three-js-being-imported/24191/5 "2023-05-11T03:04:20Z")

</div>

Didn’t really work for me with the code here:

> **[multiple instances three.js - JSFiddle - Code Playground](https://jsfiddle.net/PhilipZhu/j36m8vk7/11/)**
>
> Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/a/1/a14cd534db0cee9a520eded0b51338d6e8b34779.png)

* * *

Edit:

Turns out that it’s my “Immersive VR Emulator” Chrome extension was behind the error. The code works in incognico mode
