ruby-on-railshotwire-rails

Add Hotwire to existing Rails 6.1 app using sprockets


I'm trying to upgrade an existing Rails 6.1 with sprockets app to use stimulus. I installed

gem 'importmap-rails'
gem 'hotwire-rails'

The javascript_importmap_tags causes this error in Firefox Developer Tools:

Uncaught TypeError: Error resolving module specifier “application”. Relative module specifiers must start with “./”, “../” or “/”.

Should this work alongside sprockets? I have importmap-rails (0.7.6), stimulus-rails (0.4.2)


Solution

  • Error can safely be ignored, it doesn't cause any issues.