TypeError: $.fn.dataTable is undefined in datetime.js line 96

TypeError: $.fn.dataTable is undefined in datetime.js line 96

legroenlegroen Posts: 1Questions: 1Answers: 0
edited October 2019 in Free community support

Hi,

I have a laravel 6 project, I installed datatables.net, datatables.net-bs4 and datatables.net-plugins via npm.

I have added to app.js

require('datatables.net');
require('datatables.net-bs4');

and added to webpack.mix.js

.js('node_modules/datatables.net-bs4/js/dataTables.bootstrap4.js', 'public/js')
.js('node_modules/datatables.net-plugins/dataRender/datetime.js', 'public/js')

but I keep getting the error.

Can somebody tell me what's wrong?

Answers

  • allanallan Posts: 63,192Questions: 1Answers: 10,412 Site admin

    Could you give me a link to the resulting page or a repo that demonstrates the issue please? It might be that you need to use require('datatables.net')() - see the documentation here.

    Allan

This discussion has been closed.