Search code examples
sapui5sap-fiori

ResourceBundle error: "value for parameter 'aArgs' is not of type array"


After upgrading UI5 from 1.108 to 1.119, sap/base/i18n/ResourceBundle started showing the error below when opening one of our value help dialogs (sap.ui.comp.valuehelp.ValueHelpDialog).

value for parameter 'aArgs' is not of type array

It seems like there was a change in the implementation of the _formatValue function in ResourceBundle, which now requires that aArgs be either undefined or an array.

In the example from the sample the number items is passed as a string, while the condition operators have null as a parameter for aArgs.

Similar issues were reported in the OpenUI5 GitHub, though the sap.ui.comp library is not part of openUI5.

As far as I have seen, this does not impact the usability of the dialog but it does flood the console with errors.


Solution

  • [...] the _formatValue function in ResourceBundle, which now requires that aArgs be either undefined or an array.

    The ResourceBundle#getText API has always been requiring the aArgs argument to be an array. It's the consuming code that misaligned with the API reference. Only the error log is new. The log itself is not a breaking change (at least not in UI5 1.x) since it's simply a console log rather than throwing a real Error.

    The issue should be already fixed by now in the affected sap.ui.comp library modules.

    If you need the fix to be downported to the maintained SAPUI5 releases, consider creating a customer ticket (component: CA-UI5-CMP).