4

In Magento 2 admin menu 'Add new' page open but showing just loader image. Getting below error in console log. Anyone have any idea please share.

TypeError: data.some is not a function
winTop = win.scrollTop();

in Below file

adminhtml/Magento/backend/en_US/mage/requirejs/static.js
3
  • Did you get anywhere with this ?
    – Frank
    Nov 3, 2017 at 11:52
  • @frank which page you have getting this error in admin area , is there custom extension or default magento page ?
    – Camit1dk
    Nov 4, 2017 at 3:46
  • This error is occur because of default value not identify in admin field.
    – Camit1dk
    Nov 4, 2017 at 3:47

1 Answer 1

7

This was caused by a different issue for me. I was getting this error when trying to create a new cart price rule.

There was a patch that hadn't been run in the composer.json and a re-deploy resolved it :

"extra": {
        "magento-force": "override",
        "patches": {
            "magento/module-ui": {
                "some.data is not a function": "patches/module-ui-patch-1.diff"
            }
        }
    }

Here is the diff of this patch :

diff --git a/view/base/web/js/form/element/select.js b/view/base/web/js/form/element/select.js
index 0c266b9..22fe498 100644
--- a/view/base/web/js/form/element/select.js
+++ b/view/base/web/js/form/element/select.js
@@ -64,16 +64,17 @@ define([
     function findFirst(data) {
         var value;

-        data.some(function (node) {
-            value = node.value;
-
-            if (Array.isArray(value)) {
-                value = findFirst(value);
-            }
+        if (data instanceof Array) {
+            data.some(function (node) {
+                value = node.value;

-            return !_.isUndefined(value);
-        });
+                if (Array.isArray(value)) {
+                    value = findFirst(value);
+                }

+                return !_.isUndefined(value);
+            });
+        }
         return value;
     }
11
  • How am I meant to install this patch?
    – Wildcard27
    Nov 30, 2017 at 11:35
  • add this to your composer json "extra": { "magento-force": "override", "patches": { "magento/module-ui": { "some.data is not a function": "patches/module-ui-patch-1.diff" } } }
    – Frank
    Nov 30, 2017 at 13:04
  • Awesome. Thank you!
    – Wildcard27
    Dec 1, 2017 at 3:11
  • @Frank, can you explain it clearly, I am also facing same issue, not getting how to start this Nov 27, 2018 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.