{"id":1607,"date":"2021-02-17T18:35:19","date_gmt":"2021-02-17T18:35:19","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/solution-uncaught-referenceerror-base64-is-not-defined-in-magento-2-3\/"},"modified":"2025-05-22T11:01:23","modified_gmt":"2025-05-22T05:31:23","slug":"solution-uncaught-referenceerror-base64-is-not-defined-in-magento-2-3","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/solution-uncaught-referenceerror-base64-is-not-defined-in-magento-2-3\/","title":{"rendered":"Solved: Uncaught ReferenceError: Base64 is not Defined in Magento 2.3"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Ever faced an error in&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/magento-2-3-release\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2.3<\/a>&nbsp;that says :<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>\u201cUncaught ReferenceError: Base64 is not defined.\u201d<\/strong><\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">You might have faced this error while uploading images from admin in Magento 2.3.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you\u2019re looking for the solution of<em><strong>&nbsp;Uncaught ReferenceError: Base64 is not Defined in Magento 2.3<\/strong><\/em>&nbsp;that means, you have solved the error&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/solution-count-parameter-must-be-an-array-or-an-object-that-implements-countable-in-magento-2-3\/\" target=\"_blank\" rel=\"noreferrer noopener\">Count(): Parameter must be an array or an Object That Implements Countable in Magento 2.3&nbsp;<\/a>and then landed on this error!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Happened the same with me! Hence, I have posted the solution for the same here:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Solution for Uncaught ReferenceError: Base64 is not defined&nbsp;<em>in Magento 2.3<\/em><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the code of&nbsp;<strong>Uploader.php&nbsp;<\/strong>at&nbsp;<strong>vendor\/magento\/framework\/File\/<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">if (is_array($file) &amp;&amp; count($file) > 0 &amp;&amp; count($file[0]) > 0 &amp;&amp; count($file[1]) > 0) {<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">with the below code<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">if (is_array($file) &amp;&amp; count($file) > 0 &amp;&amp; !empty($file[0]) &amp;&amp; (isset($file[1]) &amp;&amp; !empty($file[1]))) {<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Solved!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Similar solution:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/meetanshi.com\/blog\/solved-uncaught-reference-error-require-js-is-not-defined-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Uncaught ReferenceError RequireJS Is Not Defined In Magento 2<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Feel free to share the solution with Magento community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever faced an error in&nbsp;Magento 2.3&nbsp;that says : \u201cUncaught ReferenceError: Base64 is not defined.\u201d You might have faced this error while uploading images from admin&#8230;<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1607","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1607"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1607\/revisions"}],"predecessor-version":[{"id":14486,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1607\/revisions\/14486"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}