Uncaught (in promise) Error: Filestack Picker Initialize Error in Console After Upload

761 Views Asked by At

I'm using Filestack ([email protected]) in my react app (16.12.0) and whenever I press upload on the picker I get this error in the console. The upload is working correctly and I'm getting the right result back from the onSuccess prop but I don't know if this error is caused by my app.

enter image description here

2

There are 2 best solutions below

1
Magic Marka On BEST ANSWER

It's a bug in the filestack-react package related to how it appends the file uploader to a container id for and (but < PickerOverlay /> seems to work ok) you can try create you own component like suggested https://github.com/filestack/filestack-react/issues/116#issuecomment-898969991

0
justinsAccount On

Workaround if you're doing conditional rendering:

Wrap your component, and ensure that you first render the empty containing div, then in a follow up rendering you render the internal PickerDropPane. This way the id exists before PickerDropPane looks for it.

const pickerOptions = {
  container: 'picker-container',
}

<div id="picker-container">
  <PickerDropPane pickerOptions={pickerOptions}>
</div>