question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filepicker IE11 bug: cannot upload cropped photo

See original GitHub issue

picker bug filestack-js version: 3.12.4 browser: Internet Explorer 11 polyfills: yes

The bug was introduced at some point since version 1.14.6.

“TypeError: Object doesn’t support this action” is thrown when a manually transformed file is uploaded.

Repro:

Instantiate a picker with transformations, such as

            transformations: {
              crop: {
                force: true,
                aspectRatio: 1
              }
            }
  1. Open the picker
  2. Select a file
  3. Click “Save” on the crop screen
  4. Click “Upload”
  5. onFileUploadFailed is called with the file object and TypeError

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
schutterpcommented, Feb 11, 2021

A colleague found the actual issue and we landed on filestack-js@3.7.0 as the last version we could get to work in IE11.

What they discovered is that:

the filestack-js client pins the version of the picker.js code they grab at run-time to actually display the file picker—and in https://static.filestackapi.com/picker/1.9.4/picker.js, they introduced a change which includes a call to new File.

The File constructor is not supported by IE 11 and there appear to be no easy polyfills that let us support it without changing the source code. In the most recent version of the picker.js file, this new File(…) call still exists. This means that anytime we try to have a cropped/transformed image upload in IE 11, the browser throws an error TypeError: Object doesn’t support this action and it silently fails.

https://static.filestackapi.com/picker/1.9.3/picker.js

if (a.transformed) {
  o = r
    .dispatch("resizeImageMaybe", a.transformed)
    // ...
    .then(function(t) {
      if (!r.getters.files[a.uuid]) {
        return Promise.resolve();
      }
      return e.upload(t, s, u, l);
    });
}

https://static.filestackapi.com/picker/1.9.4/picker.js

if (a.transformed) {
  o = r
    .dispatch("resizeImageMaybe", a.transformed)
    // ...
    .then(function(t) {
      if (!r.getters.files[a.uuid]) {
        return Promise.resolve();
      }
      if (t.toString() === "[object Blob]") {
        t = new File([t], t.name);
      }
      return e.upload(t, s, u, l);
    });
}
0reactions
billouboqcommented, Oct 8, 2021

Seems like a polyfill exist for this web API : https://www.npmjs.com/package/@tanker/file-ponyfill

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't upload photos with IE 11 and Windows 10
I bought a new Dell with Windows 10 preinstalled. Now I am unable to upload photos with IE 11.0. However, uploading photos with...
Read more >
filestack - Bountysource
Reading from filestack seems fine but I cannot get upload working. The data I get when selecting a photo using a file picker...
Read more >
filestack-js | Yarn - Package Manager
A multi-part uploader powered on the backend by the Filestack CIN. An interface to the Filestack Processing Engine for transforming assets via URLs....
Read more >
Cannot upload cropped image · Issue #539 · Foliotek/Croppie
Trying to upload a cropped image to server, but can only upload uncropped version. Don't know if it's a bug or there is...
Read more >
Simple Uploads Plugin for CKEditor
Improved upload progress for files; 4.0.2: 30-November-2013. Support pasting text and images from MS Word in IE 11. Avoid a problem with Chrome...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found