Notifications

59 views

Description

Console error when opening service portal catalog items:

TypeError: _.uniqBy is not a function
at js_includes_sp.jsx?v=06-05-2020_2026&lp=Fri_Jul_31_06_45_54_PDT_2020&c=34_921:44792
at fn (eval at compile (js_includes_sp_libs.jsx?v=06-05-2020_2026&lp=Fri_Jul_31_06_45_54_PDT_2020&c=34_921:13097), <anonymous>:4:219)
at regularInterceptedExpression (js_includes_sp_libs.jsx?v=06-05-2020_2026&lp=Fri_Jul_31_06_45_54_PDT_2020&c=34_921:14141)
at Scope.$digest (js_includes_sp_libs.jsx?v=06-05-2020_2026&lp=Fri_Jul_31_06_45_54_PDT_2020&c=34_921:14715)

Release or Environment

All

Cause

This error is caused when there are conflicting versions of underscore.js / lodash

Resolution

Note that ServiceNow recommend to avoid creating ui scripts for common third party libraries such as underscore / jquery / lodash. Chances are that these are already being included as part of the platform.

Search UI Scripts with name contains underscore or lodash or jquery. Deactivate custom created ones and see if the issue gets resolved.

You may also see a warning before the error which gives the name of the UI Script causing the issue like below

js_includes_sp.jsx?v=06-05-2020_2026&lp=Fri_Jul_31_06_45_54_PDT_2020&c=34_921:31531 UI Script does not return an object or function: xxxxxxx

Article Information

Last Updated:2020-08-05 09:05:11
Published:2020-08-05