-
Notifications
You must be signed in to change notification settings - Fork 178
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
Eager Load true Causes Routes To Not Be Found #512
Comments
The idea behind disabling that line when eager loading, is that the admin reloading should not be enabled. With eager loading enabled, the admin files are loaded via the Rails autoloader and registered within the Trestle registry. Then the routes are defined for each admin in Trestle's config/routes.rb. Having said that, I have seen some issues with eager loading and routes in Rails 8, although only in some failing tests, not in any actual apps. I haven't been able to get to the bottom of it fully, although I believe it may be related to rails/rails#52353. If you are indeed running Rails 8 (or even if not), could you perhaps please upload a test app to GitHub that demonstrates the issue and hopefully I can trace it further. |
Yeah I'm actually on rails 8. I'll have to upload it later but maybe you can try this on a new app with rails 8 beta? |
I just tried running this in prod but I can't because I don't have the master key. Can you try running this branch in prod? TrestleAdmin/RailsFlixDemo#32 |
So that particular branch I actually am already running in production (currently preparing it to take over https://demo.trestle.io) and I haven't encountered any issues like this yet. However the spec failures in TrestleAdmin/trestle-auth#58 seem to be related. If you're able to upload a reproduction, that would definitely be helpful for me to see what might be different. |
There is now an open PR for rails that appears to fix this issue: |
Closing as the fix has now been merged into the Rails 8-0-stable branch. |
I don't know what the reasoning is but on rails prod "eager_load" is true. And there is code here: https://github.com/TrestleAdmin/trestle/blob/main/lib/trestle/engine.rb#L41
Which in that case will not load the routes. This causes all admin routes to not be found. Is there a missing config?
The text was updated successfully, but these errors were encountered: