Jquey version update on custom widget

0
I have a custom widget. The widget imports an external dependency. Jquery-1.11.2.js I am trying to update this dependancy to the newest version of jquery. so in my dojo declare i am just replacing the current file by a new one, jquery-3.5.1.js. when i import the modified version of the widget in the modeler i get the following error: factoryThrew Error: factoryThrew     at l (http://localhost:8081/mxclientsystem/mxui/mxui.js?637326597371681115:5:426)     at http://localhost:8081/mxclientsystem/mxui/mxui.js?637326597371681115:5:9149     at Vt (http://localhost:8081/mxclientsystem/mxui/mxui.js?637326597371681115:5:9258)     at Vt (http://localhost:8081/mxclientsystem/mxui/mxui.js?637326597371681115:5:8894)     at http://localhost:8081/mxclientsystem/mxui/mxui.js?637326597371681115:5:9448     at Ht (http://localhost:8081/mxclientsystem/mxui/mxui.js?637326597371681115:5:9316)     at zt (http://localhost:8081/mxclientsystem/mxui/mxui.js?637326597371681115:5:9388)     at r (http://localhost:8081/mxclientsystem/mxui/mxui.js?637326597371681115:5:10584)     at HTMLScriptElement.<anonymous> (http://localhost:8081/mxclientsystem/mxui/mxui.js?637326597371681115:5:12807) Loading module xxxxxxxx/widget/xxxxxxxx failed! Check script file for syntax errors.  When set the jquery file back to version 1.11.2 everything works fine. Anyone an idea?
asked
2 answers
1

First, make sure you need JQuery. See the note about using it in a Mendix widget here.

If you do need it, the JQuery file that you can pack in a Dojo-based Mendix widget is pre-modified to work inside a widget. So, if you want to use a newer version, it will probably need the same edit. Diffing the official 1.11.2 version vs. the one in the widget template shows one change:

On line 10306:

if ( typeof define === "function" && define.amd ) {
	define( "jquery", [], function() {
		return jQuery;
	});
}

becomes

if ( typeof define === "function" && define.amd ) {
	define([], function() {
		return jQuery;
	});
}

 

answered
0

That did it! Thank you very much

answered