RRUI-015 · RapidRailsUI defect
Standard installer registers pagination twice
The generated Importmap controller index eagerly loads the copied pagination controller and then registers the same internal identifier again.
Upstream triage requested. This was found while following the standard RapidRailsUI installation guide in a vanilla Rails 8 application using Importmap and Tailwind CSS v4.
At a glance
| Component | `rapid_rails_ui:install` / Stimulus registration |
|---|---|
| Observed | The standard generated `index.js` calls `eagerLoadControllersFrom("controllers", application)`, which discovers `rapid-rails-ui--pagination-jumper`. The generated `registerAll(application)` then registers that fixed internal identifier a second time; the collision guard raises during boot. |
| Expected | The standard install should boot without a Stimulus identifier collision. Each controller should have one owner. |
| Impact | A fresh Importmap application can fail to start JavaScript, preventing all RapidRailsUI behavior from loading. |
Reproduction
1. Run `bin/rails generate rapid_rails_ui:install` in a vanilla Importmap app.\n2. Load `app/javascript/controllers/index.js`.\n3. Observe the eager loader and `registerAll` both target `rapid-rails-ui--pagination-jumper`.
Suggested direction
Exclude the internally eager-loaded pagination controller from the bulk registration pass, or change the generated eager-load/registration contract so internal controllers are registered exactly once.
Consumer workaround
In the generated controller index, call `registerAll(application, { except: ["pagination-jumper"] })`.