Describe the bug
Three r125 now checks if multiple different instances of the library are being imported. Weirdly, though, this is already triggered simply by following the “Installation” section of the documentation:
<script type="module">
import * as THREE from "https://unpkg.com/three/build/three.module.js";
import { OrbitControls } from "https://unpkg.com/three/examples/jsm/controls/OrbitControls.js";
/* Warning triggered */
</script>
Here’s a Codesandbox with the issue:
https://codesandbox.io/s/three-multiple-instances-warning-nkfc9
I’ve tried a bunch of other ESM CDNs (skypack and jspm, specifically), with the same results.
To Reproduce
- Visit the codesandbox
- Check the console output
Code
See above.
Live example
Expected behavior
There should not be a warning that multiple instances are being imported if they’re being imported via JS modules from CDNs.
Platform:
- Three.js version: [r125]
The bug is that this happens when following the official instructions on the website. As @donmccurdy already pointed out, it could be argued that this is a bug with the documentation, not the library itself.