Skip to content

Uncaught TypeError: this._each is not a function #39247

Open
@pjw345

Description

@pjw345

Preconditions and environment

  • Magento 2.4.7-p2
  • New Relic agents installed (not using Magento NewRelic modules)

Steps to reproduce

  1. Navigate to Dashboard (adminhtml)
  2. check console log

Expected result

Expect no console errors logged

Actual result

Lots of errors logged repeatedly:
legacy-build.min.js:1 Uncaught TypeError: this._each is not a function
at e (legacy-build.min.js:1:14513)
at nr-spa-1.267.0.min.js:2:81604
at Array.forEach ()
at y.ce [as onFinished] (nr-spa-1.267.0.min.js:2:81583)
at y.finish (nr-spa-1.267.0.min.js:2:76545)
at nr-spa-1.267.0.min.js:2:76118

Additional information

This is related to legacy-build.min.js which is released with Magento 2.4.7-p2. If the file is replaced by the version released by Magento 2.4.7-p1 the error goes away.

See also issue logged on New Relic github:
newrelic/newrelic-browser-agent#1201

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
    Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
    Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
    Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
    Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Activity

m2-assistant

m2-assistant commented on Oct 8, 2024

@m2-assistant

Hi @pjw345. Thank you for your report.
To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
🕙 You can find the schedule on the Magento Community Calendar page.
📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

pisicabogdan

pisicabogdan commented on Oct 9, 2024

@pisicabogdan

Same error on Magento 2.4.6-p6

mrafyq

mrafyq commented on Oct 15, 2024

@mrafyq

Same error on Magento 2.4.5-p10

usuyukiso

usuyukiso commented on Oct 15, 2024

@usuyukiso

reproduced for me on 2.4.7-p3. It is only reproduced with New Relic installed.

MagePsycho

MagePsycho commented on Oct 16, 2024

@MagePsycho
Contributor

Same issue on Magento 2.4.5-p2.
It is only reproduced with New Relic installed.
Got it fixed by using the legacy-build js file from Magento 2.4.7-p1 (still yet to check it's consequences)

bbrigagao

bbrigagao commented on Oct 16, 2024

@bbrigagao

I saw this error after updating projects to the bulletin APSB24-61 on projects with New Relic configured.

If you guys check the release notes there was a fix on prototype js scripts (I don't know if could be related to this).

There are 3 types of New Relic accounts and the script will be injected according to your account:

Lite - https://js-agent.newrelic.com/nr-rum-1.267.0.min.js
Pro - https://js-agent.newrelic.com/nr-full-1.267.0.min.js
SPA (pro + spa) - https://js-agent.newrelic.com/nr-spa-1.267.0.min.js

I saw this error only happens on projects that have SPA accounts, perhaps it could be an incompatibility with this SPA script.

pjw345

pjw345 commented on Oct 17, 2024

@pjw345
Author

I've checked the bulletin and have not seen anything regarding legacy-build.min.js.

https://helpx.adobe.com/security/products/magento/apsb24-61.html

@bbrigagao can you remember where you read that or did I miss it?

pisicabogdan

pisicabogdan commented on Oct 17, 2024

@pisicabogdan

Again, same error on Magento 2.4.6-p7 (last week upgraded from 2.4.6-p6).

bbrigagao

bbrigagao commented on Oct 17, 2024

@bbrigagao

@pjw345 I found that the legacy-build.min.js is related to prototype js on this issue.
So, I suspected that could be related to this since on bulletin APSB24-61 there was a fix on prototype js scripts.

scadox

scadox commented on Oct 17, 2024

@scadox

Hi Adobe Commerce Support, same problem with Magento (2.4.7-p3) and not have problem with preview (2.4.7-p2) hosted in Magento Cloud.

Where i have this problem in Admin Panel :

  • Catalog / Add product, Edit Product
  • Catalog / Categories
  • Sales / Orders, Invoices, ..
  • Content / Edit Page CMS, Block CMS
  • Stores / Configuration

Uncaught TypeError: this._each is not a function at e (legacy-build.min.js:1:14513) at nr-spa-1.268.0.min.js:2:83492 at Array.forEach (<anonymous>) at y.ce [as onFinished] (nr-spa-1.268.0.min.js:2:83471) at b.finish (nr-spa-1.268.0.min.js:2:78433) at nr-spa-1.268.0.min.js:2:78006

File from vendor lib (legacy-build.min.js) = [...] var Enumerable = (function() { function e(E, D) { try { this._each(E, D) [...]

Cordialement,
Matthew Lafrance

MagePsycho

MagePsycho commented on Oct 17, 2024

@MagePsycho
Contributor

I believe the issue can be resolved by fixing the legacy-build.min.js file directly. According to this ticket - newrelic/newrelic-browser-agent#1201, it appears that the legacy JavaScript is overriding Object.values(), which is causing the problem.

Please let us know if the Magento team or any of you have identified a permanent fix.

41 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Admin UIComponent: NewRelicReportingIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: ready for devReported on 2.4.7-p2Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @hostep@MagePsycho@jonaschen623@kvydiuk@scadox

        Issue actions

          Uncaught TypeError: this._each is not a function · Issue #39247 · magento/magento2