David Kimura PRO said almost 3 years ago on Hotwire Dashboards :
To make the stimulus controller (especially if you're using importmaps or esbuild), you can use the task

bin/rails g stimulus refresh