• Glad you got it sorted!

    I think this is actually something @Robin may have experience with as well. Basically the 'Projects' plugin for the IDE uses a pretty simplistic way of requesting module files - it tries to find one and then waits 1/4 second to see if it can get a result.

    I've literally never had one failure with this, but then I'm using Linux with an SSD. I think if you have Windows with a hard disk and a virus checker then it seems it really can take over 250ms to load a 2kb file sometimes!

    Unfortunately it's not quite as easy as just raising the delay, because that delay impacts literally everyone who is using 'projects' when they load a module that is not on their hard disk. If I raise it to 500ms then if you require 4 modules that exist on the Espruino site, that's 2 seconds of waiting around for every upload.

    The code is here if you're interested: https://github.com/espruino/EspruinoWebI­DE/blob/gh-pages/js/plugins/project.js#L­46

    While it should be possible for it to be fixed properly (eg. without a delay), Google's been threatening to close the Google Web App Store for years, in which case all this code would have to disappear anyway so it wouldn't be high priority.

    I'd say if you definitely want it to work reliably, for now it might be better for you to start a local webserver and then require("http://localhost/myfile.js") - and that will work reliably.

About

Avatar for Gordon @Gordon started