my project is using library imagekitio-react version 1.1.1 and it's work correctly. But now i want to limit image uploads to less than 5mb and version 1.1.1 IkUpLoad cannot support this. I see version 2.0.0 have onUploadStart in component. So, if i use 2.0.0 version, it throw error
Run upload error TypeError: Failed to construct 'URL': Invalid URL
at eval (imagekitio-react.umd.js?26af:213:1)
at new Promise (<anonymous>)
at generateSignatureToken (imagekitio-react.umd.js?26af:210:1)
at request (imagekitio-react.umd.js?26af:195:1)
at ImageKit.upload (imagekitio-react.umd.js?26af:327:1)
and can not upload image.
What can i do now to check size of image file upload using IKUpload here
<IKUpload
onChange={() => {
setLoadingImage(true)
}}
onError={onError}
onSuccess={onSuccess}
/>
or any solution here. Many thanks. I'm stuck with this too long.