Closed lolmaus closed 3 years ago
There seems to be a similar problem with
import Transition from '@ember/routing/-private/transition';
Type 'Transition' is missing the following properties from type 'Transition
': data, promise, catch, finally, and 5 more.ts(2740)
Thanks for the report! This usually happens when you've ended up with multiple copies of the types—it's usually the same basic issue as the error described in our docs at Conflicting Type Dependencies (although the specific error reported is different). Have you tried following the steps on that page?
@chriskrycho Thanks, fixing dependency versions with Yarn seemed to help.
But shouldn't all typing packages cross-reference the same versions of themselves? Why are their version numbers out of sync in the first place?
The docs page covers the reasons why: this is a fundamental behavior of the package managers themselves, rather than something to do with us or even the type definitions: https://docs.ember-cli-typescript.com/troubleshooting/conflicting-types
This occurs whenever your yarn.lock or package-lock.json files include more than a single copy of a given set of type definitions
@chriskrycho This is not what happened to me. In my case, there's a conflict between the latest version of @types/ember__controller
and the latest version of @types/ember__application
as they would be installed by the ember-cli-typescript
blueprint.
@types/ember__controller
is 3.16.6.
@types/ember__application
is 3.16.3 which depends on @types/ember__controller
version *
, which I assume installs the same version as parent, i. e. 3.16.3.
This is something that could be fixed by maintainers of those packages.
That would be very surprising, because the way we set up the dependencies, they are all always installed to latest, and the dependencies on DefinitelyTyped are always set to "*"
, which make sure they get installed with the latest version initially as well. However, if you update one of those in your own dependencies, it can get out of sync for the reasons described in the docs.
If you can provide a reproduction with a new app or addon where this happens, that would be helpful.
Uhm, yes, indeed the issue does not reproduce in a clean install. It probably happened to me because I was upgrading older DefinitelyTyped dependencies by hand.
Interesting: the resolutions
entry synced the dependencies, and now I'm able to remove the entry, and the issue is gone.
Thanks for kind support!
Glad to hear it!
Which package(s) does this problem pertain to?
What are instructions we can follow to reproduce the issue?
I have this class definition:
It produces the following error:
There seems to be a collision between two DefinitelyTyped libraries:
One of them is used in my file when I do
import Controller from '@ember/controller'
.The other one is used in
@ember/routing/route'
when it doesimport Controller from '@ember/controller'
(and I doimport Route from '@ember/routing/route'
).Versions
CC @simonihmig