Skip to content

Destroy command for the Stimulus controller generator doesn't update the index.js manifest #156

@tomu123

Description

@tomu123

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions