WEBPACK Uncaught TypeError: Cannot read property 'defaults' of undefined

WEBPACK Uncaught TypeError: Cannot read property 'defaults' of undefined

jabojabo Posts: 3Questions: 1Answers: 0

Hi,
I use datatable in my project with webpack encore (symfony). When i'm in dev environment everyrthing is ok, but when i deploy in production i get this error => Uncaught TypeError: Cannot read property 'defaults' of undefined

This is my app.js (require)

require('datatables.net-bs4');
require('./data-viz');
require('./infolead'); 

This is my webpack encore configuration where the jQuery provier is enable

    .autoProvidejQuery()

I have already tried to do this =>

require('datatables.net-bs4')(window,$); // THIS
require('./data-viz');
require('./infolead'); 

but this error is returned => Uncaught TypeError: Cannot set property '$' of undefined

thx

Answers

This discussion has been closed.