Upload widget never finishes or calls callbacks

I have a document editor that uses VueJS and I want to programatically open an upload widget, then get the file URL when the upload is done. This was pretty trivial to set up BUT it doesn’t work at all.

I’m loading uploadcare via CDN:

<script type="text/javascript">
  UPLOADCARE_LIVE = false; // I do not need you polling my page.
  UPLOADCARE_TABS = "file url";
  UPLOADCARE_PUBLIC_KEY = "...";
</script>
<script src="https://ucarecdn.com/libs/widget/3.3.0/uploadcare.full.min.js" charset="utf-8"></script>

I have a button to insert an image in a document, the click handler function is as follows:

var fileInput = document.createElement('input');
var widget = uploadcare.Widget(fileInput);
widget.onUploadComplete(function(info) {
  console.log("File info!", info);
});
widget.openDialog();

When I click the button the widget appears, it takes a file, it uploads the file, and the file upload IS SUCCESSFUL. In the network tab I can see the progress and see it finishes. I can see the file in my uploadcare dashboard.

But that callback function never fires, and the upload care visual aid never completes either, eg it just gets stuck looking like this: https://cl.ly/2D0z0F1m0F3P

There are no console errors.

I’ve tried everything under the sun and as far as I can tell the widget code itself is broken, because everything else works perfectly. The callback just never fires.

Can you guys help?

Hi Andrew!

The provided code snippet is correct. Moreover, I ran it on codepen and the onUploadComplete callback works properly. You can check this here: https://codepen.io/anon/pen/xzXNdd

Can you reproduce the issue on codepen, jsfiddle, etc. so I could look into it?