-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using the middleware with rails 8 breaks rails routes generation #319
Comments
try Rails.application.routes_reloader.try(:execute_unless_loaded) before config.middleware.use(JsRoutes::Middleware) |
thanks for the super quick reply, unfortunately that line leads to the app failing to boot with the following error:
|
ok, looks like need to find best way to fix this (looks like similar to heartcombo/devise#5705 ) |
Maybe adding js-routes/lib/js_routes/instance.rb Lines 25 to 27 in 9bedb7f
so it will be def generate
# Ensure routes are loaded. If they're not, load them.
application = T.unsafe(self.application)
if named_routes.empty?
if application.respond_to?(:reload_routes_unless_loaded, true)
application.reload_routes_unless_loaded
elsif application.respond_to?(:reload_routes!, true)
application.reload_routes!
end
end
... |
yes, that fixed it. I'm creating a pull request |
I've upgraded my application to rails 8 and now the line
config.middleware.use(JsRoutes::Middleware)
in development.rb causes the rails routes to be empty. Removing the line the application works as normal
The text was updated successfully, but these errors were encountered: