Failed to resolve module specifier Rails 7.0 (All components)
I am trying to use the components following the documentation
- I install the package of the component I want with
yarn. - In my
app/javascript/controllers/index.jsfile I add the component as described in the documentation.

Error displayed by the browser
Uncaught TypeError: Failed to resolve module specifier "stimulus-autocomplete". Relative references must start with either "/", "./", or "../".
I have found people with my same problem that solved it with a package call to a yarn cdn, I think it makes no sense to call a cnd with the code when the code is in local.
ruby "2.7.0" rails "7.0.2"
Did you ever solve this? I'm trying to migrate my rails 7 app from sprockets to importmaps and am getting a similar error, I believe rails isn't properly using the importmap for some reason to figure out where to load the packages from, but can't figure out where to look next.
@inspire22 You can try this way
- Import
stimulus-dropdown
./bin/importmap pin stimulus-dropdown
- Append the following lines to your controller
import { application } from "controllers/application"; # Remove this line if you are appending to application.js
import ContentLoader from 'stimulus-content-loader'
application.register('content-loader', ContentLoader)
Same as https://github.com/stimulus-components/stimulus-components/issues/81#issuecomment-2027343664