Closed GracieRen closed 2 months ago
hey @GracieRen i suspect the issue may be that the upload widget scripts haven't loaded yet im wondering if you look at the network tab for the script files if when you see this error, have they not fully completed?
if that is the case, not much i can do beyond trying to add additional logic to check if the script is loaded yet as this simply wraps the Cloudinary Upload Widget script, but the open
method, if using the CldUploadWidget, is called from the UI that you control, so you can check if the widget instance exists before triggering that method
<CldUploadWidget ... >
{({ open } = {}) => { // make sure to set the default value of an empty object in case the argument isnt defined
function handleOnClick() {
if ( typeof open === 'function' ) {
open();
}
}
return (
<button onClick={handleOnClick}>
Upload an Image
</button>
);
}}
</CldUploadWidget>
disabling/showing a spinner on the button until it's loaded, as it's also passed a isLoading
argument
<CldUploadWidget ... >
{({ isLoading, open } = {}) => { // make sure to set the default value of an empty object in case the argument isnt defined
function handleOnClick() {
if ( typeof open === 'function' ) {
open();
}
}
return (
<button onClick={handleOnClick} disabled={isLoading}> // or simply return inside of `handleOnClick` if `isLoading`
Upload an Image
</button>
);
}}
</CldUploadWidget>
going to close this since i haven't heard back but please let me know if you're still having issues after trying the above
Uploader occasionally doesn't always launch, it is a blocker for users to upload image/video.
No upload modal pops up. Checked the console and error is shown as below