Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
545 views
in Technique[技术] by (71.8m points)

javascript - Getting 'Uncaught TypeError: $(...).tablesorter is not a function' using webpack

I'm getting Uncaught TypeError: $(...).tablesorter is not a function after migrating to Rails 6 with Webpack. Here is my environment.js

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

The other plugins associated are working correctly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
...