Uncaught Error: If you load both jquery_ujs and rails-ujs, use rails-ujs only
I'm trying to debug the following error I'm getting when importing stimulus-remote
:
Uncaught Error: If you load both jquery_ujs and rails-ujs, use rails-ujs only
I'm guessing it's something to do with the way I'm importing and starting Rails
, but I can't figure out where the issue is exactly. I'm using the latest version of @rails/ujs
(6.0.3-4
).
stimulus-remote
is wired up as specified in the README:
import { Application } from "stimulus"
import { RemoteController } from "stimulus-remote"
const application = Application.start()
application.register("remote", RemoteController)
And @rails/ujs
is wired up in my application.js
like this:
import Rails from "@rails/ujs"
Rails.start()
This seems pretty standard, but somehow the importing of @rails/ujs
in stimulus-remote
combined with the importing in application.js
breaks the app