I recently migrated my project from Meteor to Webpack and am experiencing errors when trying to use Materialize.css to create my user interface. Custom materializable functions, such as $(...).tooltip, cause Uncaught TypeError to be thrown at the console. This prevents me from using Materialize in my application.
Does anyone else experience such errors when trying to use Materialize in a webpack application? Any direction on how to solve these problems would be highly appreciated. Thank!
The code that I use to load the Materialize module and its dependencies in index.js in the root of the directory is given below.
index.js:
import 'materialize-loader';
import 'materialize-css/dist/css/materialize.css';
window.jQuery = require('jquery');
window.$ = require('jquery');
import 'materialize-css/dist/js/materialize.js';
import 'materialize-css/js/init.js';