Skip to content

init in classic components takes an argument in the stable types #20483

Open
@boris-petrov

Description

@boris-petrov

🐞 Describe the Bug

init in classic components used to not accept any arguments and super.init() could be called like that. Since 5.1.0, this no longer works. I believe this is a bug.

app/components/foo-component.ts:5:11 - error TS2554: Expected 1 arguments, but got 0.

5     super.init();
            ~~~~~~

  node_modules/ember-source/types/stable/@ember/-internals/glimmer/lib/component.d.ts:786:10
    786     init(properties: object | undefined): void;
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    An argument for 'properties' was not provided.

🔬 Minimal Reproduction

Repo.

Run npm install and then ./node_modules/.bin/tsc.

😕 Actual Behavior

Type error on super.init().

🤔 Expected Behavior

No error. Removing the last commit (which upgrades Ember) and rerunning npm install and then tsc will remove the errors.

🌍 Environment

  • Ember: 5.1.0
  • Node.js/npm: 20.3.1/9.7.2
  • OS: Linux
  • Browser: N/A

cc @chriskrycho

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