Uncaught TypeError when accessing OrbitControls from unpkg.com
See original GitHub issueWith version 128, the following code:
<script type="module">
import * as THREE from 'https://unpkg.com/three@0.128.0/build/three.module.js';
import { OrbitControls } from 'https://unpkg.com/three@0.128.0/examples/jsm/controls/OrbitControls.js';
</script>
causes the following error:
Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "../".
It worked fine in 127 though.
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (3 by maintainers)
Top Results From Across the Web
9 - Stack Overflow
Not using node.js : Uncaught TypeError: Failed to resolve module specifier "three". Relative references must start with either "/", "./", or "..
Read more >three-orbitcontrols/README.md - UNPKG
I decided to create another package with a different approach, see [this issue for the rationale](https://github.com/mattdesl/three-orbit-controls/issues/17).
Read more >Why the import path for three in CDN of OrbitControls is ...
CDN of OrbitControls.js in v0.126.1 starts with the following which use a ... Uncaught TypeError when accessing OrbitControls from unpkg.com.
Read more >Why Does Three.js Need Import Maps? - Medium
An error in the browser saying Uncaught TypeError: Failed to resolve module specifier “three”. Relative references must start with either “/”, “./”, or...
Read more >mrdoob on Twitter: "What better way to celebrate than with a ...
@unpkg. , you'll have to switch to. @skypackjs. for the time being. github.com. Uncaught TypeError when accessing OrbitControls from unpkg.com · Issue ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Mugen87 https://jsfiddle.net/x1911/3x0rv8y9/
it stucks in gltf loader loading
Looks like unpkg has an experimental
?module
option you can add to the URL that allows it to work with three.js too:https://discourse.threejs.org/t/importing-jsm-modules-using-explicut-urls-no-longer-works-for-basic-jsfiddle-examples-since-r128/25858/3
I’d be curious if you are seeing loading time differences between Skypack and Unpkg?
That said, yes, local development will allow you to work much faster. So far https://www.skypack.dev/ seems like one of the more user-friendly options. Then you can deploy to something with a CDN cache (e.g. netlify handles this automatically) when you are finished working locally.