To solve TypeError: Failed to execute ‘createObjectURL’ on ‘URL’: Overload resolution failed follow any of the below methods.
Contents
Error log
TypeError: Failed to execute ‘createObjectURL’ on ‘URL’: Overload resolution failed
How to solve TypeError: Failed to execute ‘createObjectURL’ on ‘URL’: Overload resolution failed ?
I believe the error indicates that the files array may be empty. Before accessing a member, you may wish to check to see if the array is empty. So, add the below code and proceed.
if(e.target.files.length !== 0){
this.setState({image: URL.createObjectURL(e.target.files[0])})
}
Hope it solves the error.
Also Read:
Failing to install psycopg2-binary on docker container