Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 tasks
pjw345 opened this issue Oct 8, 2024 · 34 comments
Open
5 tasks

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

pjw345 opened this issue Oct 8, 2024 · 34 comments
Labels
Area: Admin UI Component: NewRelicReporting Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.7-p2 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@pjw345
Copy link

pjw345 commented Oct 8, 2024

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”.
Copy link

m2-assistant bot commented Oct 8, 2024

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
Copy link

Same error on Magento 2.4.6-p6

@mrafyq
Copy link

mrafyq commented Oct 15, 2024

Same error on Magento 2.4.5-p10

@usuyukiso
Copy link

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

@MagePsycho
Copy link
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
Copy link

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
Copy link
Author

pjw345 commented Oct 17, 2024

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
Copy link

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

@bbrigagao
Copy link

@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
Copy link

scadox commented Oct 17, 2024

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
Copy link
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.

@stefancic
Copy link

Same error on 2.4.4-p11, was not on 2.4.4-p4.

@alexgalco
Copy link

Confirmed on 2.4.7-p2

@pisicabogdan
Copy link

Changed legacy-build.min.js with the version from 2.4.6-p5 but with no effect; the problem isn't from legacy-build.min.js

@pjw345
Copy link
Author

pjw345 commented Oct 29, 2024

Changed legacy-build.min.js with the version from 2.4.6-p5 but with no effect; the problem isn't from legacy-build.min.js

We are running 2.4.7-p2 and replaced the legacy-build.min.js with the version of 2.4.7-p1

@engcom-Delta engcom-Delta self-assigned this Oct 30, 2024
Copy link

m2-assistant bot commented Oct 30, 2024

Hi @engcom-Delta. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
  • 3. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
  • 4. Verify that the issue is reproducible on 2.4-develop branch
    Details- If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
  • 5. Add label Issue: Confirmed once verification is complete.
  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@hostep
Copy link
Contributor

hostep commented Oct 30, 2024

ACP2E-3375: [CLOUD] In admin there are many javascript error in console probably fixes this problem.

@jonaschen623
Copy link

adobe has an official patch for this issue, please raise a support ticket.
Below one is for magento 2.4.6
ACSD-62427_2.4.6-p7.patch

@stefancic
Copy link

None of last two patches fix this.

@lamasfoker
Copy link

lamasfoker commented Nov 6, 2024

@stefancic the patch provided by @hostep and @jonaschen623 it's working. You need to apply this change to legacy-build.min.js:

  n(Object, {
    extend: n,
    inspect: r,
    toJSON: g ? Q : H,
    toQueryString: J,
    toHTML: v,
    keys: Object.keys || E,
-    values: N,
+    values: Object.values || N,
    clone: z,
    isElement: L,
    isArray: B,
    isHash: y,
    isFunction: t,
    isString: l,
    isNumber: M,
    isDate: A,
    isUndefined: u
  });

You can apply the following patch with Quality Patches Tool. It is tested on Adobe Commerce Cloud 2.4.6-p7.
issues-39247.patch

@engcom-Delta
Copy link
Contributor

Hi @pjw345 ,

Thanks for your reporting and collaboration.
We have verified the issue in Latest 2.4-develop instance & 2.4.8-beta1 instance, but we are unable to reproduce the issue. Kindly refer the screenshots.

Steps to reproduce

  1. Install latest 2.4-develop instance
  2. New Relic agents installed
  3. Navigate to Dashboard (adminhtml)
  4. check console log
    Observe no console error is displaying
    image

Can you please re-verify and confirm if you are still facing the issue.
Thanks.

@engcom-Delta engcom-Delta added Issue: needs update Additional information is require, waiting for response and removed Issue: ready for confirmation labels Nov 6, 2024
@engcom-Bravo engcom-Bravo moved this from Ready for Confirmation to Needs Update in Issue Confirmation and Triage Board Nov 6, 2024
@bohdanbatsenko
Copy link

Hi @pjw345 ,
I have the same issue. It exists in admin panel -> Content -> Pages -> Page builder. Try to open page builder and check console. On my staging magento website, upgraded to magento 2.47, the issue exists only in page builder editing mode.
Thanks

@engcom-Delta
Copy link
Contributor

Hi @pjw345 @bohdanbatsenko ,

Thanks for your reporting and collaboration.
We have verified the issue in Latest 2.4-develop instance and the issue is reproducible. Kindly refer the screenshots.

Steps to reproduce

  1. Install latest 2.4-develop instance
  2. New Relic agents installed
  3. Navigate to Dashboard (adminhtml)
  4. Navigate to content > pages > pagebuilder.
  5. check console log
  6. Lots of errors logged repeatedly
    image

Thanks.

@engcom-Delta engcom-Delta added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Component: NewRelicReporting Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Area: Admin UI and removed Issue: needs update Additional information is require, waiting for response labels Nov 12, 2024
@m2-community-project m2-community-project bot added Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Nov 12, 2024
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.adobe.com/browse/AC-13343 is successfully created for this GitHub issue.

Copy link

m2-assistant bot commented Nov 12, 2024

✅ Confirmed by @engcom-Delta. Thank you for verifying the issue.
Issue Available: @engcom-Delta, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@github-jira-sync-bot
Copy link

❌ You don't have permission to export this issue.

@bohdanbatsenko
Copy link

Hi @pjw345
Is there any fix to this bug?

@pjw345
Copy link
Author

pjw345 commented Nov 12, 2024

@bohdanbatsenko as previously stated, replacing the legacy-build.min.js with the version of 2.4.7-p1 appeared to resolve the issue

@engcom-Bravo engcom-Bravo moved this from Needs Update to Confirmed in Issue Confirmation and Triage Board Nov 12, 2024
@jtolhurst-trellis
Copy link

Replacing legacy-build.min.js with the version found in 2.4.7-p1 resolved the error for me. Waiting on an official fix.

@engcom-Delta engcom-Delta added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Nov 13, 2024
@hostep
Copy link
Contributor

hostep commented Nov 18, 2024

ACP2E-3375: [CLOUD] In admin there are many javascript error in console probably fixes this problem.

Another extra change made it in the codebase today: ACP2E-3459: Request for additional changes to fully complete the ACP2E-3375 fix

No idea if this will do anything in scope of this ticket...

@BharathKumarZiffity
Copy link

The given patches from @hostep and @lamasfoker does not apply in 2.4.7-p3 version (cloud) , i have used the ece-tools to apply patches and did not work.

@lamasfoker
Copy link

lamasfoker commented Nov 21, 2024

@BharathKumarZiffity if the patch that I provided it does not apply on 2.4.7-p3 version (cloud) then you can generate a new one for your version. I stated the diff in my previous message, in that way you can generate a patch on your own.

@kvydiuk
Copy link

kvydiuk commented Dec 6, 2024

Hi there,

I've seen this error on the Magento Cloud project (2.4.4-p11) when New Relic Browser's "Agent and account" setting was set to "Pro + SPA".
The error disappeared after switching this setting to "Pro" (which is logical because Magento's default theme's nature is non-SPA)
Screenshot 2024-12-06 at 2 59 08 pm

Hopefully, this will help someone.

@abhilashvijayan
Copy link

Apply the patch ACSD-63244 for Adobe commerce cloud environment. Worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Admin UI Component: NewRelicReporting Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.7-p2 Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
None yet
Development

No branches or pull requests