David Kimura PRO said about 2 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