Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Resolver in app.ts no longer compiles with the stable types #20486

Closed
boris-petrov opened this issue Jun 29, 2023 · 2 comments · Fixed by #20489
Closed

[Bug] Resolver in app.ts no longer compiles with the stable types #20486

boris-petrov opened this issue Jun 29, 2023 · 2 comments · Fixed by #20489
Labels
Bug TypeScript Work on Ember’s types

Comments

@boris-petrov
Copy link
Contributor

🐞 Describe the Bug

Check the repro.

app/app.ts:9:3 - error TS2416: Property 'Resolver' in type 'App' is not assignable to the same property in base type 'Application'.
  Type 'typeof Resolver' is not assignable to type 'ResolverClass'.
    The types returned by 'create(...)' are incompatible between these types.
      Property 'resolve' is missing in type 'CoreObject' but required in type 'Resolver'.

9   Resolver = Resolver;
    ~~~~~~~~

  node_modules/ember-source/types/stable/@ember/-internals/owner/index.d.ts:413:5
    413     resolve: (name: string) => Factory<object> | object | undefined;
            ~~~~~~~
    'resolve' is declared here.

app/app.ts:12:18 - error TS2345: Argument of type 'typeof App' is not assignable to parameter of type 'typeof Engine'.
  Construct signature return types 'App' and 'Engine' are incompatible.
    The types of 'Resolver' are incompatible between these types.
      Type 'typeof Resolver' is not assignable to type 'ResolverClass'.

12 loadInitializers(App, config.modulePrefix);
                    ~~~

🔬 Minimal Reproduction

Repo.

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

😕 Actual Behavior

Type error on Resolver.

🤔 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

@chriskrycho
Copy link
Contributor

Thanks for reporting! I confirmed this as well; a brand new ember new --typescript app doesn't type check on this specific point!

@chriskrycho
Copy link
Contributor

Will be fixed by #20489.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug TypeScript Work on Ember’s types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants