Prabhjyot Singh created AMBARI-26561:
----------------------------------------

             Summary: Ambari UI Fails to Display Hosts
                 Key: AMBARI-26561
                 URL: https://issues.apache.org/jira/browse/AMBARI-26561
             Project: Ambari
          Issue Type: Bug
          Components: ambari-web
    Affects Versions: 2.7.9
            Reporter: Prabhjyot Singh
            Assignee: Prabhjyot Singh


After upgrading *jQuery to 3.7.1* and updating {{{}jquery-migrate.js{}}}, the 
Ambari UI fails to render the *Hosts* page.
The failure occurs because {*}{{$.browser}} was removed from jQuery starting 
from version 1.9{*}, and the legacy plugin code in {{jquery.typeahead.js}} 
still depends on browser detection logic like {{{}$.browser.chrome{}}}.

This results in a runtime error and breaks initialization of the Typeahead 
component.
----
h2. *Error Trace:*
Uncaught TypeError: Cannot read properties of undefined (reading 'chrome')
    at Typeahead.listen (vendor.js:71966:21)
    at new Typeahead (vendor.js:71828:10)
    at HTMLInputElement.<anonymous> (vendor.js:72061:50)
    at ce.each (vendor.js:316:26)
    at obj.<computed>.each (vendor.js:205:19)
    at $.fn.typeahead (vendor.js:72057:17)
    at Class.didInsertElement (app.js:211853:30)
    at Class.newFunc [as didInsertElement] (vendor.js:9028:16)
    at Class.trigger (vendor.js:21579:21)
    at Class.newFunc [as trigger] (vendor.js:9028:16)
{{}}
----
h2. *Root Cause:*
 * The plugin located at:
*{{ambari-web/vendor/scripts/jquery.typeahead.js}}*
uses {*}deprecated browser sniffing{*}:
if ($.browser.chrome) \{ ... }
 
 
 * {{$.browser}} does *not exist* in jQuery ≥ 1.9 and is *fully removed* by 3.x.

 * The jQuery Migrate plugin no longer restores {{$.browser}} as of modern 
versions.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to