Skip to content
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

<trix-editor> not being triggered after upgrading from Rails 6 to Rails 7 #3714

Open
aggy-k opened this issue Feb 20, 2025 · 0 comments
Open

Comments

@aggy-k
Copy link

aggy-k commented Feb 20, 2025

Describe the bug
I've recently upgraded a Rails 6 app to Rails 7, and with it from rails_admin 2.x.x to 3.3.0. Trix Editor on rails admin form does not load properly, I can see there's <trix-editor> HTML tag when inspected, but the editor failed to load (see screenshot 1)

Image

I also use action_text outside of rails_admin in this project, and the editors load just fine outside of rails_admin.

I noticed, while on any rails admin page, the console throws this error saying that identifier "extend" has already been declared.

Image

When inspecting the js file, here are the 2 "extend" identifiers:

Image Image

Reproduction steps
Upgrading from Ruby 2.7.2 Rails 6.1 to Ruby 3.1.2 and Rails 7.1
Upgrading from rails_admin 2 to rails_admin 3.3.0
Added gem sprocket-rails that was default in Rails 6

Expected behavior
Rails admin will pick-up action_text and trix setup without any additional steps or configurations, and trix-editor will fire accordingly in a form where a model has rich_text field.
Additional context

  • rails version: 7.1
  • rails_admin version: 3.3.0
  • rails_admin npm package version: -
  • full stack trace (if there's an exception)

Installing rails admin on a fresh rails 7 app works perfectly, so wondering if there's something missing that needs to be done when upgrading from Rails 6 to 7. Any kind of help/pointers would be greatly appreciated 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant