magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Random issues in backend #37632

Closed hanaks closed 1 year ago

hanaks commented 1 year ago

Preconditions and environment

Magento version 2.4.5

Steps to reproduce

Either happens always on almost all pages in backend, or doesn't happen at all. Could be related to network delays affecting loading order of external scripts.

Expected result

No errors.

Actual result

Random JavaScript errors in backend.

Additional information

It seems that there is some random issue with Magento_AdminAnalytics module.

I started to get various JavaScript errors like these from the sudden in backend, causing stuck loaders on grids or menu not working in backend:

Uncaught Error: Mismatched anonymous define() module: function(){return cr} Uncaught TypeError: $(...).ready is not a function Uncaught TypeError: Cannot set properties of undefined (setting 'mage')

The errors disappeared after setting "Stores > Configuration > ADVANCED > Admin > Admin Usage > Enable Admin Usage Tracking" to "No".

Could be related to some network delay loading external scripts. The errors started at the same time on a hosted server and on a local dev server while no changes were made on the hosted server.

I remember the same issues long time ago at times of Magento 2.2 or similar. This could be one of the random errors which killed Magento 2.

Release note

No response

Triage and priority

m2-assistant[bot] commented 1 year ago

Hi @hanaks. 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. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

hostep commented 1 year ago

This is most likely a duplicate of:

For now, you can disable admin analytics, that seems to be what works for everyone (but it looks like you've already figured this out yourself).

m2-assistant[bot] commented 1 year ago

Hi @engcom-Bravo. 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: :point_down:

hanaks commented 1 year ago

This is most likely a duplicate of:

For now, you can disable admin analytics, that seems to be what works for everyone (but it looks like you've already figured this out yourself).

Now I recall that the issues at times of Magento 2.2 were also related to some sort of popup from "Admin Usage Tracking", so the current errors could be caused by the "help center widget" rather than network delays.

hanaks commented 1 year ago

When I add a JavaScript break point to code which calls the $(...).ready function then everything works, maybe because it gives time for js files to load. So maybe it's caused by loading order of js files?

drinkingsouls commented 1 year ago

Yes, this sounds like issue 37618 Try disabling the Admin Usage Tracking setting as mentioned in that thread and see if that temporarily resolves the JavaScript errors.

hanaks commented 1 year ago

Disabling "Admin Usage Tracking" fixes the errors, see ticket.

engcom-Bravo commented 1 year ago

@hostep @drinkingsouls Thanks for your contribution & collaboration over here.

HI @hanaks,

Thank you for reporting and collaboration.

Similar issue has been confirmed here https://github.com/magento/magento2/issues/37618 Kindly move onto this issue for latest updates / solutions on the same.We are closing this as duplicate.

Thank you.