filestack / filestack-rails

Official Ruby on Rails plugin for Filestack File Picker that makes it easy to add powerful file uploading and transformation capabilities to any web or mobile application.
https://www.filestack.com
Apache License 2.0
223 stars 101 forks source link

picker.js:1 Uncaught (in promise) TypeError: n is not a function at picker.js:1 #241

Open kopchickm opened 3 years ago

kopchickm commented 3 years ago

This is happening maybe 10% of time when uploading multiple images via the filestack picker.

The offending JS appears to be:

var r=n({tile:200});

Which could be in the resizing code, but since it's minified, it's hard to tell :) I can't find a single cause for the bug occuring - it seems to happen irrespective of file size or number of files.

I'm loading filestack in the via:

<%= filestack_js_include_tag %>
<%= filestack_js_init_tag %>

And my uploader is using filestack_picker_element with the following options:

pickerOptions: {
  accept: 'image/*',
  fromSources: ['local_file_system'],
  storeTo: {
    location: "gcs",
    container: ENV["cloud_storage_bucket"],
    path: "images/#{model_id}/#{key}/"
  },
  maxFiles: max_files,
  imageMax: [1024, 728]
},
id: "fp-#{model}-#{key}"

Thanks!

kopchickm commented 3 years ago

It looks like setting concurrency to 1 fixes the issue, if that helps.