Error "Array.prototype.map called on null or undefined" filling a filter of a table

517 views
Skip to first unread message

Claudio

unread,
May 21, 2020, 5:37:54 AM5/21/20
to Google Visualization API
Hi,
I'm using version 46 of the library.

google.load('visualization', '46', {'packages':['controls', "corechart"]});

I have a table with some filters.
The rows of the table are shown correctly but if I fill the field of a filter, I can see this error:


jsapi_compiled_format_module.js:45 Uncaught TypeError: Array.prototype.map called on null or undefined
    at map (<anonymous>)
    at gvjs_r (VM1415 jsapi_compiled_format_module.js:45)
    at gvjs_Fca (VM1416 jsapi_compiled_default_module.js:292)
    at gvjs_Jr (VM1416 jsapi_compiled_default_module.js:292)
    at gvjs_Dr (VM1416 jsapi_compiled_default_module.js:289)
    at gvjs_zr.gvjs_.Ira (VM1416 jsapi_compiled_default_module.js:282)
    at gvjs_tn.<anonymous> (VM1416 jsapi_compiled_default_module.js:186)
    at gvjs_un (VM1416 jsapi_compiled_default_module.js:64)
    at gvjs_tn.gvjs_.dispatchEvent (VM1416 jsapi_compiled_default_module.js:62)
    at gvjs_T (VM1416 jsapi_compiled_default_module.js:185)


To debug the problem all the rows are of the String type but the problem persists.
I've removed all filters but the filters of String type, that are like this one:

var stringCustomerNameFilter = new google.visualization.ControlWrapper({
'controlType': 'StringFilter',
'containerId': 'filterCustName_div',
'options': {
'width' : 10,
'filterColumnIndex': 0,
'ui': {
'label': '',
},
'matchType': 'any'
}
});

dashboard.bind(stringCustomerNameFilter, table);

Which could be the cause of this error? An incompatibility with another library? The wrong format of some row ? 
How can I debug this problem?

Thank you very much

Claudio B.





Claudio

unread,
May 21, 2020, 6:02:27 AM5/21/20
to Google Visualization API
Ok, excuse me I've solved this problem.

I've seen that was still loaded by the default this file:

drupal_add_js('https://www.google.com/jsapi', 'external');

The import was in another file of the site and I didn't see it.
Removing this import now I've solved this problem, but also this problem:

And the same code works for versions 48,47 and 46.
The problem was the jsapi file.


Now I'm using this import to fix the version of the library:
google.load('visualization', '48.1', {'packages':['controls', 'corechart']});

Thank you Daniel for your support.

Claudio B.
Reply all
Reply to author
Forward
0 new messages