WEBPACK Uncaught TypeError: Cannot read property 'defaults' of undefined
WEBPACK Uncaught TypeError: Cannot read property 'defaults' of undefined
jabo
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
This discussion has been closed.
Answers
Have you got this in a repo I can clone and built to see what is going wrong please?
Allan
Hi @allan ,
It's in a repo but i can't give you access because i don't have right role in gitlab.. and i think my client will not agree
But i can give you the build file ? (prod and/or dev)
Ok i fixed my problem with this solution =>
https://gist.github.com/jrunestone/2fbe5d6d5e425b7c046168b6d6e74e95