mdbootstrap / material-design-for-bootstrap

Important! A new UI Kit version for Bootstrap 5 is available. Access the latest free version via the link below.
https://mdbootstrap.com/docs/standard/
MIT License
9.35k stars 1.15k forks source link

Uncaught ReferenceError: bsCustomFileInput is not defined #245

Open Haves1001 opened 5 years ago

Haves1001 commented 5 years ago

Expected behavior

No error is thrown.

Actual behavior

mdb.js:15919 Uncaught ReferenceError: bsCustomFileInput is not defined at HTMLDocument.eval (mdb.js:15919)

Your working environment and MDB version information

mdbootstrap 4.8.2 included via npm and webpack.

Haves1001 commented 5 years ago

Very similar to https://mdbootstrap.com/support/jquery/bscustomfileinput-is-not-defined/

MichaelBelgium commented 5 years ago

I temporary fixed it by doing

window.bsCustomFileInput = require('mdbootstrap/js/modules/bs-custom-file-input');
//before loading mdb js
require('mdbootstrap/js/mdb');

Also duplicates #236