rails: ActionController::RoutingError (No route matches [GET] "/assets/application.js....)
I’m suddenly faced with
ActionController::RoutingError (No route matches [GET] "/assets/application.js-920efc795bbe74efc45b09c59b03e18109155fbdf62b008ca8d094aed269d334.map")
in a fresh rails 7 application using tailwind and esbuild. I cannot seem to locate where this is originating from. What might be causing this?
Removing
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
from the application.htlm.erb file removes the issue.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (2 by maintainers)
What worked for me?
rake assets:clobberAnd then regenerate the source map.
For me, I solved it by doing the following:
Followed the advice of @fhcadmin above and removed everything from my assets build directory:
rm -rf app/assets/builds/*Removed this line from
config/environments/development.rb:config.assets.prefix = "/dev-assets"Restarted by server with
bin/devand reloaded the page, the error was gone.Hope that helps someone.
For anybody googling this, manually clearing out the build artifacts fixes this
rm -rf app/assets/builds/*@SkipKayhil
Remove any css file
importwithin your javascripts files and instead them in yourapplication.scss(or whatever you call it)