Uncaught TypeError: Failed to resolve module specifier "application". Relative references must start with either "/", "./", or "../".
In rails 7 while creating an engine. It is unable to load the javascript. Also tried to load the assets in assets.rb
:
Rails.application.config.assets.precompile += %w( application.js )
In engine.rb
loaded importmap:
app.config.importmap.paths << root.join("config/importmap.rb")
New contributor
Dev Gupta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.