webmix vs DataTables debug

webmix vs DataTables debug

ToeiReiToeiRei Posts: 1Questions: 1Answers: 0

Hi guys,

I'm a bit lost about the debugger as it complains about jquery not being found while tables display fine and sweet.
Could it be the that I am missing a jquery declaration somewhere?

Cheers
Rei

I'm working with Laravel and this is my mix:

webpack.mix.js:

mix.autoload({
      jquery: ['$', 'window.jQuery', 'jQuery'],
      'popper.js/dist/umd/popper.js': ['Popper'],
      DataTable : 'datatables.net-bs4'
  })
   .js([
        'resources/js/app.js',
        'resources/assets/js/paper-dashboard.js',
    ],  'public/js')

mix.js('resources/assets/js/auth.js', 'public/js')


mix.sass('resources/sass/app.scss','public/css')
   .sass('resources/assets/sass/auth.scss','public/css')


mix.styles(['node_modules/datatables.net-bs4/css/dataTables.bootstrap4.css'], 'public/css/datatable.css')

mix.extract([
        'axios',
        'bootstrap',
        'bootstrap-notify',
        'bootstrap-sass',
        'jquery',
        'lodash',
        'popper.js',
        'vue',
   ],   'public/js/vendor.js');

/* language pack */
mix.copy('resources/lang/de/datatables.json', 'public/lang/datatables.json')

mix.version();

resources/assets/js/app.js:

// Register $ global var for jQuery
import $ from 'jquery';
window.$ = window.jQuery = $;

resources/js/bootstrap.js:

window._ = require('lodash');
window.Popper = require('popper.js').default;

try {
    window.$ = window.jQuery = require('jquery');
    require('bootstrap');
    window.toastr = require('toastr')
    require('datatables.net');
    require('datatables.net-bs4')();
    require('datatables.net-responsive-bs4')( $ );
} catch (e) {}

...

Answers

  • allanallan Posts: 61,920Questions: 1Answers: 10,153 Site admin

    Can you give me a link to the page? I can't used webmix myself, so I don't know about that level of information, but I can take a look at what it has generated and see what is going on.

    Allan

This discussion has been closed.