brian said over 2 years ago on From Webpacker to esbuild :
Did you do anything with UJS to make it work?

I am getting: Rails is not defined.

application.js
import Rails from "@rails/ujs"
window.Rails = Rails