2
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")
1
  • are you trying to load application.js from the main app or is that file in your engine? Commented Jul 4, 2024 at 12:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.