160 Experience
1 Lesson Completed
0 Questions Solved


I have a rails 6.1 application that uses jquery. Here is how I'm importing it in my config/webpack/environments.js file:

$: 'jquery/src/jquery',
jQuery: 'jquery/src/jquery',
jquery: 'jquery',
'window.jQuery': 'jquery'

I am trying to use this the stimulus-sortable component from here:

Which causes this error: Uncaught Error: If you load both jquery_ujs and rails-ujs, use rails-ujs only.

I can resolve the error by either removing jquery entirely, or removing rails ujs from my application.js file.

It appears to be specific to the stimulus-sortable component, although I'm not sure what is causing that to throw this error, as I am not importing jquery-ujs.

Any help or advice would be greatly appreciated. At this point, I'm probably just going to write my own stimulus controller.

Posted in Deploy Ubuntu 20.04 Focal Fossa Discussion

Beautiful. Thanks for the guide. Got my production environment setup and running in no time!

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2022 GoRails, LLC. All rights reserved.