# Importing certain extension causes error

**URL:** https://forum.makecode.com/t/importing-certain-extension-causes-error/1742
**Category:** Maker
**Created:** [April 18, 2020, 5:36pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742 "2020-04-18T17:36:31Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![suraj022](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/suraj022/32/821_2.png) [@suraj022](https://forum.makecode.com/u/suraj022)
#### Post date: [April 18, 2020, 5:36pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/1 "2020-04-18T17:36:31Z")

</div>

Importing certain extensions like keyboard, mouse, gamepad, etc. it causes compilation error in staticpkg hosted on github pages

steps to reproduce:

1. follow all the steps in `Local Dev Server` in pxt-maker github page.
2. use command `pxt staticpkg` to generate static page
3. host the static package on github pages like here: [https://suraj022.github.io/pxt-test/](https://suraj022.github.io/pxt-test/) (screenshots below are from localhost but it behaves the same on github page aswell)
4. open the page stated above and create a new project then select a board eq. adafruit feather-m0-express.
5. Go to advanced \> extensions and select either keyboard, mouse or gamepad
6. Go to javascript/python editor, click on explorer then select `output` on the bottom and click on output.txt  
 ![1](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/970a3bf362f6f27f4363869f59024250eaf4ea1d.png)
7. there’s an error `error: pxt\_modules/base/pxt-core.d.ts(1,1): error TS9043: The hex file is not available, please connect to internet and try again.  
 ![2](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/d3a1f6d555a89bc3f3e474142be6ce388211f66e.png)

`

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [April 19, 2020, 2:16am UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/2 "2020-04-19T02:16:22Z")

</div>

Not enough details to tell.

---

<div class="post-metadata">

### Author: ![suraj022](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/suraj022/32/821_2.png) [@suraj022](https://forum.makecode.com/u/suraj022)
#### Post date: [April 19, 2020, 7:54am UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/3 "2020-04-19T07:54:47Z")

</div>

@peli I’ve updated the post please check.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [April 19, 2020, 4:16pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/4 "2020-04-19T16:16:56Z")

</div>

If you open the JavaScript console window in the browser, you will get a detailed error message.

---

<div class="post-metadata">

### Author: ![suraj022](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/suraj022/32/821_2.png) [@suraj022](https://forum.makecode.com/u/suraj022)
#### Post date: [April 19, 2020, 6:19pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/5 "2020-04-19T18:19:50Z")

</div>

I had a look at the javascript console window and following is the error.

 ![err](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/9a60dcc6d12bd8fbdfb42cec719128688b7799c2.png)

I also tried it with my aws host and same error.

 ![err2](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/1X/6a5ffaf23cd9a3779f06c10dc18d71f1451c43af.png)

can you point me in the right direction?

thanks

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [April 19, 2020, 6:46pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/6 "2020-04-19T18:46:01Z")

</div>

The editor tries to call our cloud backend api that does the native compilation. Since you are not hosted on our server, it is unavailable to you. You will need to implement this api and host on your backend.

---

<div class="post-metadata">

### Author: ![suraj022](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/suraj022/32/821_2.png) [@suraj022](https://forum.makecode.com/u/suraj022)
#### Post date: [April 19, 2020, 7:03pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/7 "2020-04-19T19:03:02Z")

</div>

Thanks a lot for the explanation… Is there a documentation on how to implement this api?

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [April 20, 2020, 2:35am UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/8 "2020-04-20T02:35:45Z")

</div>

No docs. The client sends a complete payload of the sources and expects the compiled binary to be placed in the blob container at the SHA location. Why not using [maker.makecode.com](http://maker.makecode.com)? Cloud compilation for static packages is not supported.

---

<div class="post-metadata">

### Author: ![suraj022](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/suraj022/32/821_2.png) [@suraj022](https://forum.makecode.com/u/suraj022)
#### Post date: [April 20, 2020, 1:24pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/9 "2020-04-20T13:24:04Z")

</div>

ah ok… I’m not using [maker.makecode.com](http://maker.makecode.com) because I Have a bunch of boards with a very specific audience. And I wish to implement as a seperate instance. Is there anyway to reroute the cloud backend api to directly access your server? or host the package anyway other than using `staticpkg`  
also, is the sourcecode of cloud backend api available?

again thanks alot for your help.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [April 21, 2020, 2:40pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/10 "2020-04-21T14:40:20Z")

</div>

The editor will try to call the api at `yourdomain/api/...` so you need to make sure the requests are routed from there.  
The backend is not open source.

---

<div class="post-metadata">

### Author: ![suraj022](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/suraj022/32/821_2.png) [@suraj022](https://forum.makecode.com/u/suraj022)
#### Post date: [April 30, 2020, 6:24pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/11 "2020-04-30T18:24:15Z")

</div>

can you point me in the direction on how can I reroute such requests ( if at all ppossible)

Thanks

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [April 30, 2020, 9:01pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/12 "2020-04-30T21:01:56Z")

</div>

It will query /api/… so your web server should see those calls on the same domain as your editor.

---

<div class="post-metadata">

### Author: ![MakerlabLeon](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@MakerlabLeon](https://forum.makecode.com/u/MakerlabLeon)
#### Post date: [August 7, 2020, 6:20pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/13 "2020-08-07T18:20:59Z")

</div>

some one fix this error??  
I´ve the same problem with the gamepad extension in [maker.makecode.com](http://maker.makecode.com) with the circuit playground bluefruit.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/f/f27a83d16f499d285288d1ca29000e650f2166be.png)

---

<div class="post-metadata">

### Author: ![suraj022](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/suraj022/32/821_2.png) [@suraj022](https://forum.makecode.com/u/suraj022)
#### Post date: [August 7, 2020, 6:41pm UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/14 "2020-08-07T18:41:46Z")

</div>

Unfortunately there’s no way to fix this problem unless devs open-source their makecode api backend.

---

<div class="post-metadata">

### Author: ![peli](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/peli/32/12_2.png) [@peli](https://forum.makecode.com/u/peli)
#### Post date: [August 24, 2020, 3:51am UTC](https://forum.makecode.com/t/importing-certain-extension-causes-error/1742/15 "2020-08-24T03:51:45Z")

</div>

@suraj022 please file a bug in [github.com/microsoft/pxt](http://github.com/microsoft/pxt) to document the build api. We do not have plans to open source the backend as it is specific to our cloud infrastructure, but we can documentation the protocol.
