Methods like modal() not working if Bootstrap loaded with Webpack (Rails)
问题 In my Rails 5 app, if I load Bootstrap 4 using a header <script> tag from a CDN, everything works fine. But when I install Bootstrap (and its dependencies) to node_modules , and serve it with Webpack, it mostly still works... but the jQuery methods Bootstrap is supposed to add like $(foo).modal() or $(bar).popover() give errors in the JavaScript console: Uncaught TypeError: $(...).modal is not a function Uncaught TypeError: $(...).popover is not a function There are several other