Skip to content

@action decorator creates an "actions" hash on the host object #19143

Closed

Description

@chancancode

🐞 Describe the Bug

When using the @action decorator on a method, it tries to check if the object has an actions hash and do stuff with it. This breaks when the object happens to have an actions property that is not what it expects.

🔬 Minimal Reproduction

For example:

class MyComponent extends GlimmerComponent {
  get actions() {
    return this.args.actions.map(...);
  }
}

😕 Actual Behavior

It should not error.

🤔 Expected Behavior

It errors.

In this specific case, it errors because setupAction tries to call MyComponent.actions on the class, so the getter function is called with the wrong this (the class, not the instance) and it errors. In other case it may cause other more subtle failures, or in other cases it may just result in unnecessary work.

🌍 Environment

  • Ember: 3.20

➕ Additional Context

I asked @rwjblue about this and he said it's most likely unintended behavior. His suggestion was that we check for actions being a concatenated property before doing this.

Activity

  1. kategengler commented on Aug 11, 2026

    @kategengler
    Member

    TargetActionSupport has now been deprecated. #21517

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions