Episodes
daijinara PRO said over 1 year ago on Deeper Dive into StimulusJS :
better to put this line of code.

import Rails from "@rails/ujs";

Otherwise, Rails.ajax call will be undefined.

Also, adding the intergration with select2 would be better, since it does not fire native events.