As you may know, I'm currently developing an "Analog Clock Construction Kit" which (currently) heavily relies on external modules required from GitHub.
However, there are modules which behave differently depending on whether they are actually loaded from GitHub (by the Web IDE) or manually inserted into the code using the following "trick"
let exports = {}
<<<< insert module here
let XXX = exports
as a replacement for
let XXX = require('<GitHub URL>');
Two modules are affected - and I don't know why:
rounded clock hands - work fine when inserted manually, but produce wrong graphics when loaded from GitHub
smart clock size calculator - works fine (even if loaded from GitHub), but produces an annoying error toast (Error: Unreachable point. logically broken. in https://raw.githubusercontent.com/rozek/banglejs-2-smart-clock-size/main/ClockSize.js) in the WebIDE
Does anybody have any ideas how to solve these problems?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
As you may know, I'm currently developing an "Analog Clock Construction Kit" which (currently) heavily relies on external modules
require
d from GitHub.However, there are modules which behave differently depending on whether they are actually loaded from GitHub (by the Web IDE) or manually inserted into the code using the following "trick"
as a replacement for
Two modules are affected - and I don't know why:
Error: Unreachable point. logically broken. in https://raw.githubusercontent.com/rozek/banglejs-2-smart-clock-size/main/ClockSize.js
) in the WebIDEDoes anybody have any ideas how to solve these problems?