Error: Cannot read properties of undefined (reading 'value') File JS: jquery.dataTables.min.js

Error: Cannot read properties of undefined (reading 'value') File JS: jquery.dataTables.min.js

CesarB18CesarB18 Posts: 1Questions: 0Answers: 0

Error messages shown:
In the browser console show:

Cannot read properties of undefined (reading 'value')

Description of problem:
In the original file "jquery.dataTables.min.js" the line that generates an error for the variable zc has the value 3 as an index:
if (Intl) { var zc = (new Intl.NumberFormat).formatToParts(1000.1); xc = zc[1].value; yc = zc[3].value }

Error:
yc = zc[3].value

Screenshot Error

Description of Solution:
Modifying the value of the index of the variable zc to 2 the error is resolved:
if (Intl) { var zc = (new Intl.NumberFormat).formatToParts(1000.1); xc = zc[1].value; yc = zc[2].value }

Solution:
yc = zc[2].value

Note: this error is also being presented on the website https://datatables.net/

Replies

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Note: this error is also being presented on the website https://datatables.net/

    I'm not seeing any errors on that page.

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • crewlbncrewlbn Posts: 1Questions: 0Answers: 0

    Dear Colin

    I got the same problem. All further details that I have already traced are below:
    file: jquery.dataTables.js:15298

     var num = new Intl.NumberFormat().formatToParts(1000.1);
    __thousands = num[1].value;
    __decimal = num[3].value;
    

    Variable num has has only three elements:

    thus num[3] index does not exists.

  • kthorngrenkthorngren Posts: 20,142Questions: 26Answers: 4,736

    I think you are running into the same issue as this thread. See Allan's comment at the end.

    Kevin

Sign In or Register to comment.