question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with jquery-ui-effect (Magento 2.4.4)

See original GitHub issue

Edit 03/05/2022 : Just remove the two files from the magepack.config.js to solve the issue…

Good afternoon,

I have a situation with your wonderful extension and the new released magento 2.4.4 version. Indeed, the two files from jquery-ui updated framework :

  1. lib/web/jquery/ui-modules/effects/effect-fade.js
  2. lib/web/jquery/ui-modules/effects/effect-blind.js

Which were reworked from the previous version, throws an error only when I magepack them (with the standard minification and bundle I do not have any issue).

This is the error I have in my developer console for the homepage : Uncaught Error: Mismatched anonymous define() module: function($){"use strict";return $.effects.define("fade","toggle",(function(e,t){var n="show"===e.mode;$(this).css("opacity",n?0:1).animate({opacity:n?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:t})}))}

This error is also throwed by blind effect.

So far, I can either remove them from the magepack.config.js (requirejs we will download them as standalone version) or correct them manually by naming them.

Exemple for effect-fade.js :


/*!
 * jQuery UI Effects Fade 1.13.0
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */

//>>label: Fade Effect
//>>group: Effects
//>>description: Fades the element.
//>>docs: http://api.jqueryui.com/fade-effect/
//>>demos: http://jqueryui.com/effect/

( function( factory ) {
	"use strict";

	if ( typeof define === "function" && define.amd ) {

		// AMD. Naming the module
		define('jquery-ui-effect-fade', [
		// AMD. Register as an anonymous module.
		//define( [
			"jquery",
			"../version",
			"../effect"
		], factory );
	} else {

		// Browser globals
		factory( jQuery );
	}
} )( function( $ ) {
"use strict";

return $.effects.define( "fade", "toggle", function( options, done ) {
	var show = options.mode === "show";

	$( this )
		.css( "opacity", show ? 0 : 1 )
		.animate( {
			opacity: show ? 1 : 0
		}, {
			queue: false,
			duration: options.duration,
			easing: options.easing,
			complete: done
		} );
} );

} );

These two JS files are used for :

  • fade.js for minicart
  • blind.js for message

a Pull Request advice to suppress them for the native code of Magento for native CSS Transition and native function from jQuery itself : https://github.com/magento/magento2/pull/32886

Not sure if this error come from our current configuration as it heavy customized,

Did you meet this issue also on Magento 2.4.4 ?

Magento 2.4.4 have also a mapping error for Magento_Theme module (which is not related to my current issue) : https://github.com/magento/magento2/issues/35327

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:7
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
NathanDayFEcommented, May 31, 2022

I have had the same issue and to work around this temporarily decided to go with naming the modules, however my issue wasn’t just with the 2 classes mentioned in the OP description but with most of the jQuery UI effects. The main reason for naming rather than removing is that when the config was generated again the changes would again have to be made manually and there would be a chance this would be missed, instead i have created a .patch to be installed when composer runs.

Patch for magento/magento2-base

diff --git a/lib/web/jquery/ui-modules/effects/effect-blind.js b/lib/web/jquery/ui-modules/effects/effect-blind.js
index 3b65a4f..513a89b 100644
--- a/lib/web/jquery/ui-modules/effects/effect-blind.js
+++ b/lib/web/jquery/ui-modules/effects/effect-blind.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-blind', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-bounce.js b/lib/web/jquery/ui-modules/effects/effect-bounce.js
index 76e0f85..c5b1c1f 100644
--- a/lib/web/jquery/ui-modules/effects/effect-bounce.js
+++ b/lib/web/jquery/ui-modules/effects/effect-bounce.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-bounce', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-clip.js b/lib/web/jquery/ui-modules/effects/effect-clip.js
index 12b49f4..5954547 100644
--- a/lib/web/jquery/ui-modules/effects/effect-clip.js
+++ b/lib/web/jquery/ui-modules/effects/effect-clip.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-clip', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-drop.js b/lib/web/jquery/ui-modules/effects/effect-drop.js
index 8f3ba74..3451b06 100644
--- a/lib/web/jquery/ui-modules/effects/effect-drop.js
+++ b/lib/web/jquery/ui-modules/effects/effect-drop.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-drop', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-explode.js b/lib/web/jquery/ui-modules/effects/effect-explode.js
index f3976fc..546c81b 100644
--- a/lib/web/jquery/ui-modules/effects/effect-explode.js
+++ b/lib/web/jquery/ui-modules/effects/effect-explode.js
@@ -21,7 +21,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-explode', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-fade.js b/lib/web/jquery/ui-modules/effects/effect-fade.js
index f84d6c4..d523404 100644
--- a/lib/web/jquery/ui-modules/effects/effect-fade.js
+++ b/lib/web/jquery/ui-modules/effects/effect-fade.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-fade', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-fold.js b/lib/web/jquery/ui-modules/effects/effect-fold.js
index 682af57..c2e8a06 100644
--- a/lib/web/jquery/ui-modules/effects/effect-fold.js
+++ b/lib/web/jquery/ui-modules/effects/effect-fold.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-fold', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-highlight.js b/lib/web/jquery/ui-modules/effects/effect-highlight.js
index 41ecc6f..7c6b72c 100644
--- a/lib/web/jquery/ui-modules/effects/effect-highlight.js
+++ b/lib/web/jquery/ui-modules/effects/effect-highlight.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-highlight', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-puff.js b/lib/web/jquery/ui-modules/effects/effect-puff.js
index 4448843..737049b 100644
--- a/lib/web/jquery/ui-modules/effects/effect-puff.js
+++ b/lib/web/jquery/ui-modules/effects/effect-puff.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-puff', [
 			"jquery",
 			"../version",
 			"../effect",
diff --git a/lib/web/jquery/ui-modules/effects/effect-pulsate.js b/lib/web/jquery/ui-modules/effects/effect-pulsate.js
index 0787e2a..7138c8a 100644
--- a/lib/web/jquery/ui-modules/effects/effect-pulsate.js
+++ b/lib/web/jquery/ui-modules/effects/effect-pulsate.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-pulsate', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-scale.js b/lib/web/jquery/ui-modules/effects/effect-scale.js
index 0e4c291..af65927 100644
--- a/lib/web/jquery/ui-modules/effects/effect-scale.js
+++ b/lib/web/jquery/ui-modules/effects/effect-scale.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-scale', [
 			"jquery",
 			"../version",
 			"../effect",
diff --git a/lib/web/jquery/ui-modules/effects/effect-shake.js b/lib/web/jquery/ui-modules/effects/effect-shake.js
index b12eb1f..ed63687 100644
--- a/lib/web/jquery/ui-modules/effects/effect-shake.js
+++ b/lib/web/jquery/ui-modules/effects/effect-shake.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-shake', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-size.js b/lib/web/jquery/ui-modules/effects/effect-size.js
index 91aeea7..dada2f1 100644
--- a/lib/web/jquery/ui-modules/effects/effect-size.js
+++ b/lib/web/jquery/ui-modules/effects/effect-size.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-size', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-slide.js b/lib/web/jquery/ui-modules/effects/effect-slide.js
index 1ce84f0..90d1061 100644
--- a/lib/web/jquery/ui-modules/effects/effect-slide.js
+++ b/lib/web/jquery/ui-modules/effects/effect-slide.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-slide', [
 			"jquery",
 			"../version",
 			"../effect"
diff --git a/lib/web/jquery/ui-modules/effects/effect-transfer.js b/lib/web/jquery/ui-modules/effects/effect-transfer.js
index 231a4e6..539fded 100644
--- a/lib/web/jquery/ui-modules/effects/effect-transfer.js
+++ b/lib/web/jquery/ui-modules/effects/effect-transfer.js
@@ -19,7 +19,7 @@
 	if ( typeof define === "function" && define.amd ) {
 
 		// AMD. Register as an anonymous module.
-		define( [
+		define('jquery-ui-effect-transfer', [
 			"jquery",
 			"../version",
 			"../effect"

3reactions
rhoerrcommented, Oct 14, 2022

Based on a site running 2.4.5-p1, ui-modules/core may also trigger the anonymous define issue.

index 231a4e6..539fded 100644
--- a/lib/web/jquery/ui-modules/core.js
+++ b/lib/web/jquery/ui-modules/core.js
@@ -2,7 +2,7 @@
 ( function() {
 "use strict";

-define( [
+define('jquery/ui-modules/core', [
 	"jquery",
 	"./data",
 	"./disable-selection",
Read more comments on GitHub >

github_iconTop Results From Across the Web

Magento 2 console notice - Fallback to JQueryUI Compat ...
Magento is basically loading all jQuery UI modules because it can't identify which one(s) the custom code needs.
Read more >
How to use jQuery and require js in Magento 2? - Amasty
Learn to use base elements in Magento 2 jQuery to manage evens via JavaScript. ... the set of add-ons to improve the UI,...
Read more >
Magento Open Source 2.4.4 release notes | Adobe Commerce
Learn about new features, enhancements, bug fixes and known issues in the 2.4.4 Magento Open Source release.
Read more >
Guide for Magento 2 Layered Navigation Ajax Filter with Multi ...
Fixed an issue that caused the browser back button to return to the previous page when Ajax Filters were applied, as opposed to...
Read more >
Changelog - Navigationpro - SwissUpLabs docs
Fixed not-working “click” menu on Magento 2.4.4 (jQuery UI conflict). · PHP 8.1 compatibility: passing null to explode is deprecated. · Fixed transparent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found