Cannot read properties of undefined

Cannot read properties of undefined

mkymky Posts: 1Questions: 1Answers: 0

Debugger code (debug.datatables.net):

Uncaught TypeError: Cannot read properties of undefined (reading 'sVersion')
    at gatherData (DT_Debug.js:512:36)
    at DT_Debug.js:497:13
gatherData @ DT_Debug.js:512
(anonymous) @ DT_Debug.js:497
setTimeout (async)
(anonymous) @ DT_Debug.js:496
dispatch @ jquery-3.6.0.js:5430
elemData.handle @ jquery-3.6.0.js:5234

Error messages shown:

jquery.dataTables.js:15301 Uncaught TypeError: Cannot read properties of undefined (reading 'value')
    at jquery.dataTables.js:15301:22
    at jquery.dataTables.js:55:22
    at jquery.dataTables.js:58:1
(anonymous) @ jquery.dataTables.js:15301
(anonymous) @ jquery.dataTables.js:55
(anonymous) @ jquery.dataTables.js:58
dataTables.bootstrap4.js:47 Uncaught TypeError: Cannot read properties of undefined (reading 'defaults')
    at dataTables.bootstrap4.js:47:27
    at dataTables.bootstrap4.js:39:3
    at dataTables.bootstrap4.js:41:2
(anonymous) @ dataTables.bootstrap4.js:47
(anonymous) @ dataTables.bootstrap4.js:39
(anonymous) @ dataTables.bootstrap4.js:41
dataTables.responsive.js:1414 Uncaught TypeError: Cannot read properties of undefined (reading 'Api')
    at dataTables.responsive.js:1414:26
    at dataTables.responsive.js:45:3
    at dataTables.responsive.js:47:2
(anonymous) @ dataTables.responsive.js:1414
(anonymous) @ dataTables.responsive.js:45
(anonymous) @ dataTables.responsive.js:47
$.fn.dataTable
undefined

**Description of problem**: 
DataTables does not work after updating to the latest version

Link to test case:

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.12.0/css/dataTables.bootstrap4.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/responsive/2.3.0/css/responsive.bootstrap4.css" />



<table id="example" class="display" style="width:100%">
    <thead>
        <tr>
            <th>Name</th>
            <th>Position</th>
            <th>Office</th>
            <th>Age</th>
            <th>Start date</th>
            <th>Salary</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Tiger Nixon</td>
            <td>System Architect</td>
            <td>Edinburgh</td>
            <td>61</td>
            <td>2011-04-25</td>
            <td>$320,800</td>
        </tr>
    </tbody>
</table>

<script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.12.0/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.12.0/js/dataTables.bootstrap4.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/responsive/2.3.0/js/dataTables.responsive.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/responsive/2.3.0/js/responsive.bootstrap4.js"></script>
<script type="text/javascript" src="https://debug.datatables.net/bookmarklet/DT_Debug.js"></script>

Answers

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

    That works as expected here - http://live.datatables.net/wekexoku/1/edit . Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.

    Cheers,

    Colin

Sign In or Register to comment.