Expected behavior
Running bin/rails destroy stimulus NAME should:
- Remove the corresponding controller file
- Update
index.js automatically, removing both the import statement and the application.register(...) line for the deleted controller
Actual behavior
- The controller file is deleted successfully
index.js is not updated, leaving behind stale references to the removed controller
Notes
- If I manually run
bin/rails stimulus:manifest:update after the destroy command, index.js is updated correctly.
- This suggests a race condition where the manifest update runs before the file is actually removed which is weird since it seems to work fine with generate.
Environment
- Rails: 7.1.5.2
- Ruby: 3.3.1
- OS: Linux (running inside Docker)
Expected behavior
Running
bin/rails destroy stimulus NAMEshould:index.jsautomatically, removing both theimportstatement and theapplication.register(...)line for the deleted controllerActual behavior
index.jsis not updated, leaving behind stale references to the removed controllerNotes
bin/rails stimulus:manifest:updateafter the destroy command,index.jsis updated correctly.Environment