Ahh. I'll have a look at this today, it may have come up before. It could well be a bug in the module handling that happens for the 'projects' code in the Web IDE.
For now, I guess you could just pass it in:
var mymodule = require("mymodule").connect(require("HC-SR04"), ...)
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.
Ahh. I'll have a look at this today, it may have come up before. It could well be a bug in the module handling that happens for the 'projects' code in the Web IDE.
For now, I guess you could just pass it in: