Solved: Uncaught ReferenceError: Base64 is not Defined in Magento 2.3

Ever faced an error in Magento 2.3 that says :

“Uncaught ReferenceError: Base64 is not defined.”

You might have faced this error while uploading images from admin in Magento 2.3.

If you’re looking for the solution of Uncaught ReferenceError: Base64 is not Defined in Magento 2.3 that means, you have solved the error Count(): Parameter must be an array or an Object That Implements Countable in Magento 2.3 and then landed on this error!

Happened the same with me! Hence, I have posted the solution for the same here:

Solution for Uncaught ReferenceError: Base64 is not defined in Magento 2.3

Replace the code of Uploader.php at vendor/magento/framework/File/

if (is_array($file) && count($file) > 0 && count($file[0]) > 0 && count($file[1]) > 0) {

with the below code

if (is_array($file) && count($file) > 0 && !empty($file[0]) && (isset($file[1]) && !empty($file[1]))) {

Solved!

Similar solution:

Feel free to share the solution with Magento community via social media.

Thank you.

Jignesh Parmar

Article by

Jignesh Parmar

An expert in his field, Jignesh is the team leader at Meetanshi and a certified Magento developer. His passion for Magento has inspired others in the team too. Apart from work, he is a cricket lover.