When turning the asset digests off (https://guides.rubyonrails.org/asset_pipeline.html#turning-digests-off) in the development environment by setting config.assets.digest to false in config/environments/development.rb the file assets/stimulus-loading.js will not load and you will get an HTTP 404 for that file:

Changing config/importmap.rb to pin to stimulus-loading instead of stimulus-loading.js will make it work in the environments where the asset digests are turned off, the file will then however not be included in the production assets when precompiling them.
I have created a new Rails app where you can reproduce this issue here: https://github.com/mrkcor/stimulus-loading-issue
For anyone looking for a workaround for this issue: you can put a copy of the file stimulus-loading.js in vendor/javascript and pin the file as is indicated in the README.
When turning the asset digests off (https://guides.rubyonrails.org/asset_pipeline.html#turning-digests-off) in the development environment by setting
config.assets.digesttofalseinconfig/environments/development.rbthe fileassets/stimulus-loading.jswill not load and you will get an HTTP 404 for that file:Changing
config/importmap.rbto pin tostimulus-loadinginstead ofstimulus-loading.jswill make it work in the environments where the asset digests are turned off, the file will then however not be included in the production assets when precompiling them.I have created a new Rails app where you can reproduce this issue here: https://github.com/mrkcor/stimulus-loading-issue
For anyone looking for a workaround for this issue: you can put a copy of the file
stimulus-loading.jsinvendor/javascriptand pin the file as is indicated in the README.