Module [font] not found

Posted on
  • I'm trying to add a a set of fonts to Graphics.
    The list is big, so I'm using an array. (Below list is just an example)

    ["FontTeletext10x18Mode7", "FontHaxorNarrow7x17", "Font8x12"].forEach((font) => {

    I get back an error, Module FontTeletext10x18Mode7 not found.
    However, adding them individually seems to work.

    // WORKS

    Why can't I use an array to add fonts?

  • The fonts (and most other modules) aren't built-in to the watch: when you do require("Font8x12"), the uploader is smart enough to figure out you want to use Font8x12, and includes it in-line with the uploaded code.
    But the uploader isn't smart enough to figure out which module to include for require(<variable>).

  • Ohh I see, thank you! Is my second code block the only way to do it then?

  • Is my second code block the only way to do it then?

    More or less, yes... You need the actual text require("FontTeletext10x18Mode7") in the code. You could do [require("FontTeletext10x18Mode7"), ...] and so on though.

  • Ah alright, thank you Gordon!

  • Hey again Gordon, I have the following on the top of my file.


    Still when I try to run my program on my Bangle.js 1 it returns Uncaught Error: Module FontTeletext10x18Mode7 not found.
    I have tried using adding it on both the right and left-hand sides of the IDE. The left side gives me the same error.

    What can I do?

    EDIT: I solved it, I was uploading the JS file when I should have run it through the IDE.

  • Font not found after upgrade to firmware 2v14.
    current firmware version is 2v14 and bootloader is 2v12.

    >Uncaught Error: Module Font8x16 not found
     at line 1 col 19

    Settings/Communications Module URL is set to

    Please advise.

  • It looks like something is wrong with my Chrome in Linux. It cannot load modules for Emulator too.
    Chrome in Windows works well.

    It appears that in windows it does not work same way when I put into Settings. It works with HTTPS.

    I've put that in Linux Chrome. And it works!

  • I think it's pretty standard - if you look at the chrome dev console it'll probably say something like "Can't load insecure HTTP from secure HTTPS page". should have been set as the default modules URL, so is it possible you changed it to http?

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Module [font] not found

Posted by Avatar for Asynchronous @Asynchronous