After updating to Rails 6 with Webpack, I'm encountering the error message
Uncaught TypeError: $(...).tablesorter is not a function
. Below is the snippet of my environment.js file:
const { environment } = require('@rails/webpacker')
const webpack = require('webpack')
environment.plugins.prepend('Provide',
new webpack.ProvidePlugin({
$: 'jquery/src/jquery',
jQuery: 'jquery/src/jquery',
tablesorter: 'tablesorter',
bootstrap: 'bootstrap/dist/js/bootstrap',
draggable: 'plain-draggable'
})
)
module.exports = environment
All other plugins seem to be functioning correctly.