# Importing GLB from a GitHub repository

**URL:** https://talk.observablehq.com/t/importing-glb-from-a-github-repository/6290
**Category:** Help
**Created:** [February 27, 2022, 8:56am UTC](https://talk.observablehq.com/t/importing-glb-from-a-github-repository/6290 "2022-02-27T08:56:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ferrari212](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/ferrari212/32/6224_2.png) [@ferrari212](https://talk.observablehq.com/u/ferrari212)
#### Post date: [February 27, 2022, 8:56am UTC](https://talk.observablehq.com/t/importing-glb-from-a-github-repository/6290/1 "2022-02-27T08:56:04Z")

</div>

Hi,

In previous version of observable I was importing a GLB file from my github repository.  
[https://observablehq.com/@ferrari212/section-2-6-inserting-gltf-and-creating-a-more-realistic-mod](https://observablehq.com/@ferrari212/section-2-6-inserting-gltf-and-creating-a-more-realistic-mod)

This is the peace of the code I used before, where the boatPath is the url pointing to the source:

```nohighlight
{
  loaderGLTF.load(
    boatPath,
    (gltf) => {
      var shipGLTF = gltf.scene;
      shipGLTF.rotation.x = Math.PI / 2;
      shipGLTF.rotation.y = -Math.PI / 2;
      shipGLTF.position.set(-1, 0, 0);
      shipGLTF.name = "ModelGLTF";

      if (shipGLTF.material) {
        shipGLTF.material.side = THREE.DoubleSide;
      }

      scene.add(shipGLTF);
    },
    (xhr) => {
      mutable loaderPecentage = (xhr.loaded / 31780028) * 100;
    }
  );
}

```

In the newer version, however, I am not able to import it and by checking the console I noticed I receive a CORS issue problem and error 200. I want to know if there is a new procedure to import it from another source than observable. I saw some solutions using FileAttachment but I would rather prefer to keep with the one I am using.

Regards,  
Felipe

---

<div class="post-metadata">

### Author: ![tomlarkworthy](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tomlarkworthy/32/5940_2.png) [@tomlarkworthy](https://talk.observablehq.com/u/tomlarkworthy)
#### Post date: [February 27, 2022, 9:39am UTC](https://talk.observablehq.com/t/importing-glb-from-a-github-repository/6290/2 "2022-02-27T09:39:47Z")

</div>

[CORS Proxy fetchp / Tom Larkworthy / Observable](https://observablehq.com/@tomlarkworthy/fetchp) (remember to publish and wait a few seconds)

---

<div class="post-metadata">

### Author: ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)
#### Post date: [February 27, 2022, 11:32am UTC](https://talk.observablehq.com/t/importing-glb-from-a-github-repository/6290/3 "2022-02-27T11:32:15Z")

</div>

You don’t need a CORS proxy. Just use the following path:

```auto
https://raw.githubusercontent.com/ferrari212/vesseljs/master/examples/3D_models/GLTF/Gunnerus.glb

```

I would also recommend to pin the file to the current version by replacing `/master/` with `/3624e9c/` (the file’s most recent commit ID).

* * *

Note that your current [`boatPath`](https://github.com/ferrari212/vesseljs/blob/master/examples/3D_models/GLTF/Gunnerus.glb) points to Github’s _web interface showing the file_, not the file itself. I suspect this is not the actual path used in your original code?

---

<div class="post-metadata">

### Author: ![tomlarkworthy](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/tomlarkworthy/32/5940_2.png) [@tomlarkworthy](https://talk.observablehq.com/u/tomlarkworthy)
#### Post date: [February 27, 2022, 8:55pm UTC](https://talk.observablehq.com/t/importing-glb-from-a-github-repository/6290/4 "2022-02-27T20:55:28Z")

</div>

oops, my bad, yeah CORS bypass not required for Github. I did not comprehend the context properly.

---

<div class="post-metadata">

### Author: ![ferrari212](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/ferrari212/32/6224_2.png) [@ferrari212](https://talk.observablehq.com/u/ferrari212)
#### Post date: [March 6, 2022, 8:57am UTC](https://talk.observablehq.com/t/importing-glb-from-a-github-repository/6290/5 "2022-03-06T08:57:22Z")

</div>

Hi @mootari and @tomlarkworthy ,

Thanks for the help. Yes, in fact the url I was pointing was wrong. I had to request from a github open site instead of my own repo:  
[https://ferrari212.github.io/vesseljs/examples/3D\_models/GLTF/Gunnerus.glb](https://ferrari212.github.io/vesseljs/examples/3D_models/GLTF/Gunnerus.glb)

Thanks for the help!
