Getting Uncaught TypeError error: cannot read 'defaults' properties from undefined to datatable

I use require and datatable. I wrote the following code to work with data:

require.config({
    paths : {
        bootstrap : 'lib/bootstrap',
        jquery : 'lib/jquery-1-9-0-min',
        datatable:'lib/jquery.dataTables',
        datatablebootstrapDT:'lib/DT_bootstrap',
    },
    shim : {
        bootstrap : {
            deps : [ 'jquery' ],
            exports : 'Bootstrap'
        },
        datatable:{
            deps : [ 'jquery' ],
            exports : 'DataTable',
        },
        datatablebootstrapDT:{
            deps : [ 'jquery', 'bootstrap', 'datatablebootstrap' ],
            exports : 'DatatablebootstrapDT'
        },
    }
});

I get the following error:

Uncaught TypeError: Unable to read 'defaults' properties from undefined in dataTables.bootstrap.js: 2

below is the code in line 2

$.extend( true, $.fn.dataTable.defaults, {

I searched a lot for this, but no luck.

+4
source share

Source: https://habr.com/ru/post/1584495/


All Articles