Bug ID 1621317: Uncaught (in promise) TypeError: Failed to construct 'MouseEvent': Please use the 'new' operator, this DOM object constructor cannot be called as a function.

Last Modified: Aug 07, 2024

Affected Product(s):
BIG-IP APM(all modules)

Known Affected Versions:
16.1.2.2, 16.1.3, 16.1.3.1, 16.1.3.2, 16.1.3.3, 16.1.3.4, 16.1.3.5, 16.1.4, 16.1.4.1, 16.1.4.2, 16.1.4.3, 16.1.5

Opened: Jul 29, 2024

Severity: 3-Major

Symptoms

Below console error in devtools Uncaught (in promise) TypeError: Failed to construct 'MouseEvent': Please use the 'new' operator, this DOM object constructor cannot be called as a function.

Impact

Unable to download CSV files

Conditions

Portal Access with Modern JS

Workaround

Custom irule: ========== when REWRITE_REQUEST_DONE { if { [HTTP::path] ends_with "index.html" } { set flgx 1 REWRITE::post_process 1 } } when REWRITE_RESPONSE_DONE { if {[info exists flgx]} { unset flgx set str {if(typeof(F5_flush)} set strt [string first $str [REWRITE::payload]] if {$strt > 0} { REWRITE::payload replace $strt 0 { (function (window) { // Polyfills DOM4 MouseEvent const MouseEventPolyfill = function (eventType, params) { params = params || { bubbles: false, cancelable: false }; const mouseEvent = document.createEvent('MouseEvent'); mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, window, 0, params.screenX || 0, params.screenY || 0, params.clientX || 0, params.clientY || 0, params.ctrlKey || false, params.altKey || false, params.shiftKey || false, params.metaKey || false, params.button || 0, params.relatedTarget || null ); return mouseEvent; } MouseEventPolyfill.prototype = Event.prototype; window.MouseEvent = MouseEventPolyfill; })(window); } } } } ==========

Fix Information

None

Behavior Change

Guides & references

K10134038: F5 Bug Tracker Filter Names and Tips