Do you have the code for this widget somewhere on Github? It sounds to me it will be loaded as a global variable in the page, which most of the times works fine locally. Yet, when you run it on the cloud, it will be bundled together with all other widgets. External libraries might not me working in the cloud.