skypackjs / skypack-cdn

An issue tracker for the CDN
107 stars 5 forks source link

SyntaxError: The requested module does not provide an export named 'default' at #281

Open s-cork opened 2 years ago

s-cork commented 2 years ago

I was trying to import Three.js's OrbitControl module

I defined the following:

<script type="importmap">
  {
    "imports": {
      "three": "https://cdn.skypack.dev/three@0.138.0"
    }
  }
</script>
<script type="module">
  import {OrbitControls} from "https://cdn.skypack.dev/three@0.138.0/examples/jsm/controls/OrbitControls.js";
</script>

Gives the following error:

Uncaught SyntaxError: The requested module '/-/three@v0.138.0-zvVD8VzksUZ5anXAslX5/dist=es2019,mode=raw/examples/jsm/controls/OrbitControls.js' does not provide an export named 'default'